vue-cli 多页面配置,移除 prefetch 和 preload

代码如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

pages: {
index: {
entry: 'src/pages/front/main.js',
template: 'index.html',
title: 'index_page'
},
project: {
entry: 'src/pages/admin/main.js',
template: 'project.html',
filename: 'project.html',
title: 'project_page'
}
},


chainWebpack: config => {


// 官方配置配置 config.plugins.delete('prefetch')

// page 名称发生变化
config.plugins.delete('prefetch-index')
config.plugins.delete('preload-index')

config.plugins.delete('prefetch-project')
config.plugins.delete('preload-project')
},

官方文档