chore(frontend): 更新前端配置文件和构建脚本

- 更新 uni-app 配置文件(manifest.json、vue.config.js)
- 新增 babel.config.js 和 uni-h5-polyfill.js 支持
- 更新缓存工具类(cache.js、index.js)
- 新增 nginx-crmeb.conf 部署配置
- 更新 package-lock.json
This commit is contained in:
apple
2026-03-10 13:50:35 +08:00
parent 9bb10cbe57
commit 263df94d95
12 changed files with 319 additions and 115 deletions

View File

@@ -1,5 +1,39 @@
module.exports = {
productionSourceMap: false, // 生产打包时不输出map文件增加打包速度
devServer: {
port: 8080,
proxy: {
'/api': {
target: 'http://127.0.0.1',
changeOrigin: true
},
'/uploads': {
target: 'http://127.0.0.1',
changeOrigin: true
},
'/statics': {
target: 'http://127.0.0.1',
changeOrigin: true
}
}
},
chainWebpack: config => {
const HX_BABEL = '/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules'
const optionalChaining = require.resolve('@babel/plugin-proposal-optional-chaining', { paths: [HX_BABEL] })
const nullishCoalescing = require.resolve('@babel/plugin-proposal-nullish-coalescing-operator', { paths: [HX_BABEL] })
config.module.rule('js').use('babel-loader').tap(options => {
options = options || {}
options.plugins = options.plugins || []
const pluginPaths = options.plugins.map(p => (Array.isArray(p) ? p[0] : p))
if (!pluginPaths.includes(optionalChaining)) {
options.plugins.push(optionalChaining)
}
if (!pluginPaths.includes(nullishCoalescing)) {
options.plugins.push(nullishCoalescing)
}
return options
})
},
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false