23 lines
551 B
JavaScript
23 lines
551 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
// 开发模式通过代理访问内网后端;生产模式同源部署在 Django 下
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
// 同源托管在 Django /static/ 下(whitenoise),根路径 index.html 由 Django 返回
|
|
base: '/static/',
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://192.168.5.7:18050',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'dist',
|
|
chunkSizeWarningLimit: 1500,
|
|
},
|
|
})
|