-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Description
Version
3.1.0
Reproduction link
Node and OS info
v8.11.3
Steps to reproduce
1、vue-cli3中,在vue.config.js文件中配置了pages参数进行多页面开发,pages参数中的chunks采用默认配置。
2、进行npm run build 后,打包后,dist文件夹中有两个入口 index.html 和mobile.html . 而这两个html都引用了同一个chunk-vendors。
3、由于index页面是全局引用element-ui的,所以导致chunk-vendors文件特别大。但是mobile页面是不需要引入element-ui的。
4、请问vue.config.js怎么配置才能实现把vue,vue-router等公用的打包成chunk-vendors,而各个页面再打包自身所需要的chunks,就如打包成三个chunks: chunk-vendors.js (index.html 和mobile.html 都引用) ,chunk-index.js(index.html引用), chunk-mobile.js(mobile.html引用)?
What is expected?
减少mobile.html加载的大小,chunk-vendors被分离
What is actually happening?
参看其他步骤
weituotian
Metadata
Metadata
Assignees
Labels
No labels