Files
aue/vite.config.js
2026-06-03 13:16:30 +08:00

46 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
// 生产环境基础路径(服务器访问根目录,必须写 ./
base: './',
resolve: {
alias: {
'@': '/src'
}
},
// 优化依赖配置
optimizeDeps: {
include: ['vue', 'axios', 'ant-design-vue', 'xlsx', 'marked', 'highlight.js', 'docx-preview', 'file-saver', 'epubjs']
},
// 本地开发代理(仅本地生效,打包后自动忽略)
server: {
port: 5173,
strictPort: false,
host: 'localhost',
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setTimeout(0)
})
},
proxyTimeout: 0
},
'/exam': {
target: 'http://localhost:8080',
changeOrigin: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
proxyReq.setTimeout(0)
})
},
proxyTimeout: 0
}
}
}
})