Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vue] 如何解决vue打包vendor过大的问题? #343

Open
haizhilin2013 opened this issue Jun 20, 2019 · 4 comments
Open

[vue] 如何解决vue打包vendor过大的问题? #343

haizhilin2013 opened this issue Jun 20, 2019 · 4 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

haizhilin2013 commented Jun 20, 2019

[vue] 如何解决vue打包vendor过大的问题?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 20, 2019
@haizhilin2013 haizhilin2013 changed the title [vue] 如何解决vue打包wendor过大的问题? [vue] 如何解决vue打包vendor过大的问题? Jun 28, 2019
@persist-xyz
Copy link

1、在webpack.base.conf.js新增externals配置,表示不需要打包的文件,然后在index.html中通过CDN引入

externals: {
    "vue": "Vue",
    "vue-router": "VueRouter",
    "vuex": "Vuex",
    "element-ui": "ELEMENT",
    "BMap": "BMap"
  }

2、使用路由懒加载 官网

@Ankhyang
Copy link

Ankhyang commented Mar 9, 2021

开启gzip压缩

@wanlixi
Copy link

wanlixi commented Apr 8, 2022

CDN
tree-shaking
splitChunksPlugin
commonChunksPlugin
路由懒加载

@1101334809
Copy link

1、在webpack.base.conf.js新增externals配置,表示不需要打包的文件,然后在index.html中通过CDN引入

externals: {
    "vue": "Vue",
    "vue-router": "VueRouter",
    "vuex": "Vuex",
    "element-ui": "ELEMENT",
    "BMap": "BMap"
  }

2、使用路由懒加载 官网

CDN引入会有些许问题,https模式下会有安全验证,使得cdn引入失败。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

5 participants