|
import { fileURLToPath, URL } from 'node:url' |
|
import { resolve, dirname } from 'node:path' |
|
|
|
import { defineConfig } from 'vite' |
|
import vue from '@vitejs/plugin-vue' |
|
import vueDevTools from 'vite-plugin-vue-devtools' |
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url); |
|
const __dirname = dirname(__filename); |
|
|
|
|
|
export default defineConfig({ |
|
base: '/', |
|
plugins: [ |
|
vue(), |
|
vueDevTools(), |
|
], |
|
resolve: { |
|
alias: { |
|
'@': fileURLToPath(new URL('./src', import.meta.url)) |
|
}, |
|
}, |
|
build: { |
|
|
|
outDir: resolve(__dirname, '../app/templates/assets'), |
|
|
|
emptyOutDir: true, |
|
|
|
rollupOptions: { |
|
output: { |
|
|
|
entryFileNames: 'main.js', |
|
chunkFileNames: '[name].js', |
|
assetFileNames: (assetInfo) => { |
|
if (assetInfo.name === 'style.css') { |
|
return 'main.css'; |
|
} |
|
|
|
return '[name].[ext]'; |
|
} |
|
} |
|
} |
|
}, |
|
}) |
|
|