38 lines
749 B
TypeScript
38 lines
749 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({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:5555',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
assetsDir: 'static',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
// 将所有 node_modules 的依赖打包到 vendor
|
|
if (id.includes('node_modules')) {
|
|
return 'vendor'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|