1 Star 0 Fork 131

碎月留年 / Workflow

forked from StavinLi / Workflow 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
lichen39 提交于 2022-08-04 16:27 . feat: publicPath修改
const CompressionWebpackPlugin = require('compression-webpack-plugin'),
productionGzipExtensions = ['js', 'css'];
let path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
lintOnSave: false,
productionSourceMap: false,
publicPath: process.env.NODE_ENV === "production" ? '/Workflow/dist/' : '/',
devServer: {
disableHostCheck: true,
https: false, // https:{type:Boolean}
port: 6969,
},
chainWebpack: config => {
config.resolve.alias.set('@', resolve('src'));
config.performance.set('hints', false);
config.output.filename('[name].[hash].js').end();
},
configureWebpack: config => {
//配置参数详解https://www.webpackjs.com/plugins/compression-webpack-plugin/
if (process.env.NODE_ENV !== 'development') { // 非开发环境
config.plugins.push(new CompressionWebpackPlugin({
algorithm: 'gzip', //algorithm: 可以是 function(buf, callback) 或者字符串。对于字符串来说依照 zlib 的算法(或者 zopfli 的算法)。默认值是 "gzip"。
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'), //test: 所有匹配该正则的资源都会被处理。默认值是全部资源。
threshold: 10240, //threshold: 只有大小大于该值的资源会被处理。单位是 bytes。默认值是 0。
minRatio: 0.8 //minRatio: 只有压缩率小于这个值的资源才会被处理。默认值是 0.8。
}))
}
}
}
JavaScript
1
https://gitee.com/mzg5050_admin_admin/Workflow.git
git@gitee.com:mzg5050_admin_admin/Workflow.git
mzg5050_admin_admin
Workflow
Workflow
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891