1
0
镜像自地址 https://github.com/PanJiaChen/vue-element-admin.git 已同步 2026-12-03 10:23:37 +08:00

fix[chore]: do not preload runtime.js (#3279)

这个提交包含在:
花裤衩 2020-06-23 21:12:44 +08:00 提交者 GitHub
父节点 585391228e
当前提交 73a9ab0379
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23

查看文件

@ -50,7 +50,16 @@ module.exports = {
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
// config.plugins.delete('preload')
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
@ -118,6 +127,7 @@ module.exports = {
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)