2025-08-26 10:01:43 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
import { resolve } from 'path'
|
|
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
2025-09-08 11:53:34 +08:00
|
|
|
base: '/admin',
|
|
|
|
|
// base: '/',
|
2025-08-26 10:01:43 +08:00
|
|
|
plugins: [vue()],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': resolve(__dirname, 'src')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
port: 5174,
|
2025-09-11 10:02:40 +08:00
|
|
|
host:'0.0.0.0',
|
2025-08-26 10:01:43 +08:00
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
|
|
|
|
target: 'http://localhost:3000',
|
|
|
|
|
changeOrigin: true
|
|
|
|
|
},
|
2025-09-08 11:53:34 +08:00
|
|
|
'/admin': {
|
|
|
|
|
target: 'http://localhost:3000',
|
|
|
|
|
changeOrigin: true
|
|
|
|
|
},
|
2025-08-26 10:01:43 +08:00
|
|
|
'/uploads': {
|
|
|
|
|
target: 'http://localhost:3000',
|
|
|
|
|
changeOrigin: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
outDir: 'dist',
|
|
|
|
|
assetsDir: 'assets',
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks: {
|
|
|
|
|
vendor: ['vue', 'vue-router', 'pinia'],
|
|
|
|
|
elementPlus: ['element-plus'],
|
|
|
|
|
charts: ['echarts', 'vue-echarts']
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|