加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1013 Bytes
一键复制 编辑 原始数据 按行查看 历史
Jie 提交于 2021-07-14 13:39 . V1.3.0
/*
* @Author: fjt
* @Date: 2021-07-07 21:25:33
* @LastEditors: fjt
* @LastEditTime: 2021-07-07 22:40:49
*/
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
lintOnSave: false,
devServer: {
open: true,
overlay: {
warnings: true,
errors: true
}
},
publicPath: '/assets/admin',
filenameHashing: true,
productionSourceMap: false,
configureWebpack: config => {
config.optimization.splitChunks = {
cacheGroups: {
common: {
name: 'commom',
minChunks: 2,
priority: -20,
chunks: 'initial',
reuseExistingChunk: true
},
vendors: {
name: 'vendors',
test: /[\\/]node_modules[\\/]/,
chunks: 'initial',
priority: -10
}
}
};
if (process.env.BUNDLE_ANALYZER === 'YES') {
return {
plugins: [new BundleAnalyzerPlugin()]
};
}
},
chainWebpack: config => {}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化