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
204 views
in Technique[技术] by (71.8m points)

build提示文件过大

The bundle size is significantly larger than recommended.

image.png

这个怎么解决呀

The bundle size is significantly larger than recommended.
Consider reducing it with code splitting: https://umijs.org/docs/load-on-demand
You can also analyze the project dependencies using ANALYZE=1

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

1 Answer

0 votes
by (71.8m points)

有提示的原因是 webpack performance 的配置,单个文件过大的时候,给开发者一个提示信息。可以了解下:https://webpack.js.org/config...

要想去除有两种方式:
一是 通过 chainWebpack 设置 maxEntrypointSize 到一个够大的值,或者设置 hints 为false;
而是借助 umi 的配置项,设置 动态引入、external 、调整 splitChunks 策略等。参考:https://umijs.org/zh-CN/guide...


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

...