admin管理员组文章数量:1335403
I would like to ask if there is any method to slim my Next.JS bundle. Especially the Node Modules - which leads to the Browser loading so much MBs, therefore slowing down the initial browsing.
Here is the analysis:
I am wele to give more information whenever you ask more.
I would like to ask if there is any method to slim my Next.JS bundle. Especially the Node Modules - which leads to the Browser loading so much MBs, therefore slowing down the initial browsing.
Here is the analysis:
I am wele to give more information whenever you ask more.
Share Improve this question asked May 24, 2018 at 4:37 Vanson Wing LeungVanson Wing Leung 3255 silver badges14 bronze badges1 Answer
Reset to default 6It looks like you're using webpack, here are a couple things to try:
Code Splitting
Code splitting is one of the most pelling features of webpack. This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can be used to achieve smaller bundles and control resource load prioritization which, if used correctly, can have a major impact on load time.
Tree Shaking
Tree shaking is a term monly used in the JavaScript context for dead-code elimination. It relies on the static structure of ES2015 module syntax, i.e. import and export. The name and concept have been popularized by the ES2015 module bundler rollup.
本文标签: javascriptNextjsBundle Size too Large (3MB)Stack Overflow
版权声明:本文标题:javascript - Next.js - Bundle Size too Large (~3MB) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742387331a2465294.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论