viappio's avatar

vite dev server and prod build do not match

I developed a project using npm run dev (and so the vite command). But when i tried to build it statically and run npm run build (and so vite build command), some of the code doesn't work. E.g Pikaday and folders configured in the config/filesystem.php file. I'm getting mad. I can't figure out what it could be. Here's my vite.config.js file

import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: ["resources/js/app.js",
                "resources/css/app.css",
                "resources/css/porting.css",
                "resources/css/AdminLTE.min.css",
            ],
            refresh: [
                ...refreshPaths,
                'app/Http/Livewire/**',
            ],
        }),
    ],
    resolve: {
        alias: {
            '$': 'jQuery'
        },
    },
});

and my package.json

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build && vite build --ssr"
    },
    "devDependencies": {
        "@alpinejs/focus": "^3.10.5",
        "@inertiajs/vue3": "^1.0.0",
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.0",
        "@vitejs/plugin-vue": "^4.0.0",
        "@vue/server-renderer": "^3.2.31",
        "alpinejs": "^3.0.6",
        "autoprefixer": "^10.4.7",
        "axios": "^1.1.2",
        "laravel-vite-plugin": "^0.7.5",
        "postcss": "^8.4.14",
        "tailwindcss": "^3.1.0",
        "vite": "^4.0.0"
    },
    "dependencies": {
        "@alpinejs/focus": "^3.12.3",
        "@alpinejs/persist": "^3.13.2",
        "alpinejs": "^3.12.3",
        "jquery": "^3.7.0",
        "moment": "^2.29.4",
        "pikaday": "^1.8.2",
        "select2": "^4.1.0-rc.0",
        "tinymce": "^6.8.1",
        "vue": "^3.2.31"
    }
}
0 likes
0 replies

Please or to participate in this conversation.