35 lines
799 B
TypeScript
35 lines
799 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
base: './', // nginx部署用
|
|
plugins: [
|
|
vue(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
chunkSizeWarningLimit: 1500,
|
|
cssCodeSplit: true,
|
|
minify: 'esbuild',
|
|
rollupOptions: {
|
|
output: {
|
|
chunkFileNames: 'static/js/[name]-[hash].js',
|
|
entryFileNames: 'static/js/[name]-[hash].js',
|
|
assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
|
|
manualChunks (id) {
|
|
if (id.includes("node_modules")) {
|
|
return 'vendor'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
})
|