54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
rewrite: (proxyPath) => proxyPath.replace(/^\/api/, '/api'),
|
|
},
|
|
'/images': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
'/uploads': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
'/static': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
api: 'modern-compiler',
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
vendor: ['vue', 'vue-router', 'pinia'],
|
|
element: ['element-plus', '@element-plus/icons-vue'],
|
|
utils: ['axios', 'dayjs', '@vueuse/core'],
|
|
charts: ['echarts', 'vue-echarts'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|