Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.2k views
in Technique[技术] by (71.8m points)

splitchunks 多页应用打包问题

使用 splitchunks 提取的公共资源即使没有使用到的页面也会引用,比如有 a, b, c 三个入口,其中 a 和 b 都引用了一个 vendor.js,然后用 splitchunks 提取 vender.js 之后,这个 vender.js 也会出现在 c 的页面上,实际上 c 没有使用到这个 vender.js。

webpack 版本如下:

"webpack": "^5.4.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

用这个移除试试
图片.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...