Files
martial-mini/vue.config.js
Developer cdee00b503
Some checks failed
continuous-integration/drone/push Build is failing
fix: disable report and add fallback for build errors
2025-12-13 10:23:24 +08:00

46 lines
977 B
JavaScript

/**
* Vue CLI 配置文件
* 用于配置开发服务器代理,解决跨域问题
*/
module.exports = {
// 输出目录
outputDir: 'dist/build/h5',
// 静态资源目录
assetsDir: 'static',
devServer: {
proxy: {
// 代理所有 /api 开头的请求
'/api': {
target: 'http://localhost:8123', // 后端服务地址
changeOrigin: true, // 改变请求源
ws: true, // 支持websocket
pathRewrite: {
// 将 /api 重写为空,因为后端没有 /api 前缀
'^/api': ''
}
}
}
},
// 确保 transpileDependencies 配置正确
transpileDependencies: [],
// 生产环境配置
productionSourceMap: false,
// 禁用 gzip 大小报告,避免构建时的文件读取问题
css: {
extract: true
},
chainWebpack: config => {
// 禁用 gzip 大小报告
if (process.env.NODE_ENV === 'production') {
config.performance.hints(false)
}
}
}