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

使用externals减少build文件大小无效 #1409

Closed
liuz7899347 opened this issue Jul 2, 2020 · 4 comments
Closed

使用externals减少build文件大小无效 #1409

liuz7899347 opened this issue Jul 2, 2020 · 4 comments

Comments

@liuz7899347
Copy link

版本号:

v2.1.4

问题描述:

npm run build后打包文件过大,导致第一次加载时页面加载慢。
解决方案:
在vue.config.js中配置externals,实现打包时排除相关组件,在index.html中通过cdn外部引入,但打包时仍然把排除后的组件打包进去。

截图&代码:

image
image

友情提示: 未按格式要求发帖,会直接删掉。

@zhangdaiscott
Copy link
Member

image

头三个应该好使,可以不加cdn看看,其他的排除名字怕匹配的不对

@liuz7899347
Copy link
Author

liuz7899347 commented Jul 3, 2020

我配置下面四个走cdn,在当前项目不起作用,打包后大小都在22M左右,和没有配置时打包的大小一样。
但是我其他非jeecg项目,配置后能减少8M左右的大小。
您能否帮忙看看,是否存在同样的问题,这个问题确实影响页面加载的速度,感谢
image

我其他项目配置走cdn后打包大小是180kb:
image

未配置走cdn打包的大小:
image

@huanlirui
Copy link

如何处理的?求教?

@huanlirui
Copy link

我配置下面四个走cdn,在当前项目不起作用,打包后大小都在22M左右,和没有配置时打包的大小一样。 但是我其他非jeecg项目,配置后能减少8M左右的大小。 您能否帮忙看看,是否存在同样的问题,这个问题确实影响页面加载的速度,感谢 image

我其他项目配置走cdn后打包大小是180kb: image

未配置走cdn打包的大小: image

解决了么?同样有这个问题。

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

No branches or pull requests

3 participants