![]() Webpack recommends that a bundle should be a maximum 250kb unminified. Maybe you use a heavy dependency for something really simple that you can code yourself? Do you see some large bundles in the report? Read more in the article You Probably Don’t Need Moment.js Anymore This is fully possible in modern JavaScript. And the recommendation that has least impact on your bundle is using no library at all. The team discourage Momentjs from being used in new projects and they have stopped develop new features for it. If you see momentjs in your report, then this might be possible. The best way to reduce the bundle size is if you can remove something completely. ![]() Are you depending on deprecated libs (for example moment?) Or send a PR to them improving the usage of lodash. ![]() You can consider stop using it and replace it with something different. When you have identified the guilty dependency, there is unfortunately not much you can do. There you’ll see a detailed report of every dependency of your project. The thing you can do in that case is to find which dependency has lodash as dependency. What to do then? Then most likely one of your dependencies has lodash as a dependency. Sometimes you can see lodash in the webpack bundle analyzer, but you don’t have lodash in your package.json file. This is how it looks if you include lodash without tree-shaking it: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |