|
@@ -50,7 +50,15 @@ module.exports = {
|
50
|
50
|
},
|
51
|
51
|
chainWebpack(config) {
|
52
|
52
|
// it can improve the speed of the first screen, it is recommended to turn on preload
|
53
|
|
- // config.plugins.delete('preload')
|
|
53
|
+ config.plugin('preload').tap(() => [
|
|
54
|
+ {
|
|
55
|
+ rel: 'preload',
|
|
56
|
+ // to ignore runtime.js
|
|
57
|
+ // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
|
|
58
|
+ fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
|
|
59
|
+ include: 'initial'
|
|
60
|
+ }
|
|
61
|
+ ])
|
54
|
62
|
|
55
|
63
|
// when there are many pages, it will cause too many meaningless requests
|
56
|
64
|
config.plugins.delete('prefetch')
|
|
@@ -118,6 +126,7 @@ module.exports = {
|
118
|
126
|
}
|
119
|
127
|
}
|
120
|
128
|
})
|
|
129
|
+ // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
121
|
130
|
config.optimization.runtimeChunk('single')
|
122
|
131
|
}
|
123
|
132
|
)
|