Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion hoj-vue/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,16 @@ module.exports={
config.plugin('webpack-bundle-analyzer') // 查看打包文件体积大小
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
// ============注入cdn end============
if(isProduction) {
config.output.filename('assets/js/app.[contentHash].js')
} else {
config.output.filename('assets/js/app.js')
}
},
configureWebpack: (config) => {
// 用cdn方式引入,则构建时要忽略相关资源
const plugins = [];
if (isProduction || devNeedCdn){
if (isProduction){
config.externals = cdn.externals
config.mode = 'production';
config["performance"] = {//打包文件大小配置
Expand Down Expand Up @@ -125,6 +130,8 @@ module.exports={
minRatio: 0.8 // 压缩比
})
)
} else {
config.externals = cdn.externals
}
}

Expand Down