-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Open
Description
Version
3.8.4
Environment info
windows10 node10
Steps to reproduce
1、使用vue-cli3初始化的一个多页面应用,参照下面的链接配置了多页面
https://cli.vuejs.org/zh/config/#pages
pages:{
index:{
entry: filePath,
filename: index.html,
template: 'public/index.html',
hash: true,
chunks: ['chunk-vendors', 'index']
}
b: ......
}
2、在vue.config.js中添加splitChunks配置抽取共通chunk,如下:
config.optimization
.splitChunks({
chunks: 'all',
minChunks: 1,
maxInitialRequests: 4,
maxAsyncRequests: 5,
automaticNameDelimiter: '-',
.....
})
3、结果:
打包出来的index.html中,只引入了chunk-vendors.js index.js,
通过splitChunks共通出来的chunk文件,比如index~b.js,没有被引入index.js中。
因为动态生成的chunks的文件名不固定,如何让它们自动被引入对应的html中?
What is expected?
因为动态生成的chunks的文件名不固定,如何让它们自动被引入对应的html中?
What is actually happening?
动态生成的chunks,没有被引入到html中
Metadata
Metadata
Assignees
Labels
No labels