1 Star 4 Fork 13

赖闽杰 / pigx-ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
赖闽杰 提交于 2024-05-16 20:33 . 添加抽奖记录查询条件
/**
* 配置参考:
* https://cli.vuejs.org/zh/config/
*/
const url = 'http://pigx-gateway:9999'
//const url = 'https://dev.ylggz.com.cn'
//const url = 'https://mini.mzcnf.com'
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
module.exports = {
// 保存时是否保存 eslint 检查
lintOnSave: false,
productionSourceMap: false,
chainWebpack: config => {
const entry = config.entry('app')
entry
.add('babel-polyfill')
.end()
entry
.add('classlist-polyfill')
.end()
},
css: {
// 忽略 CSS order 顺序警告
extract: { ignoreOrder: true }
},
configureWebpack: (config) => {
if (process.env.NODE_ENV === 'production') {
// 仅在生产环境下启用该配置
return {
performance: {
// 打包后最大文件大小限制
maxAssetSize: 1024000
},
plugins: [
new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 1024, // 只有大小大于该值的资源会被处理,当前配置为对于超过1k的数据进行处理,不足1k的可能会越压缩越大
minRatio: 0.99, // 只有压缩率小于这个值的资源才会被处理
deleteOriginalAssets: true // 删除原文件
})
]
}
}
},
// 配置转发代理
devServer: {
disableHostCheck: true,
port: 8080,
proxy: {
'/': {
target: url,
ws: false, // 需要websocket 开启
pathRewrite: {
'^/': '/'
}
}
}
}
}
1
https://gitee.com/lai-minjie1/pigx-ui.git
git@gitee.com:lai-minjie1/pigx-ui.git
lai-minjie1
pigx-ui
pigx-ui
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891