33 lines
772 B
TypeScript
33 lines
772 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/element-plus') || id.includes('node_modules/@element-plus')) {
|
|
return 'element-plus'
|
|
}
|
|
if (
|
|
id.includes('node_modules/vue') ||
|
|
id.includes('node_modules/vue-router') ||
|
|
id.includes('node_modules/axios')
|
|
) {
|
|
return 'vendor'
|
|
}
|
|
return undefined
|
|
},
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
})
|