import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
publicDir: false,
plugins: [
// laravel([
// 'resources/css/app.css',
// 'resources/js/app.js',
// ]),
laravel({
refresh: true,
publicDirectory: 'public',
// buildDirectory: 'public',
// input: ['./resources/css/app.css', './resources/js/app.js'],
}),
],
build: {
emptyOutDir: false,
manifest: true,
rollupOptions: {
input: ['resources/js/app.js'],
output: {
entryFileNames: `assets/js/app.js`,
assetFileNames: file => {
let ext = file.name.split('.').pop();
if (ext === 'css') {
return 'assets/css/app.css';
}
return 'assets/[name].[ext]';
}
}
},
outDir: 'public',
},
});
"devDependencies": {
...
"autoprefixer": "^10.4.14",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3",
"laravel-vite-plugin": "^0.7.8",
"vite": "^4.4.7",
...
},
...
@vite(['resources/css/app.css', 'resources/js/app.js'])
или
@vite([helloworld_path('resources/css/app.css'), helloworld_path('resources/js/app.js')])
...