2

My webpack builds are running out of memory, so I'm trying to debug it using the webpack analyse tool. The odd thing is, none of the hints about prefetching include code from my project. Everything is from node_modules, and more specifically, webpack modules.

Here are a couple of examples:

enter image description here

enter image description here

I checked out this post: How to optimize webpack's build time using prefetchPlugin & analyse tool?

but it doesn't really explain why the "hints" section only includes node_modules dependencies, and after reading it, I'm still not completely sure how the prefetching works. In the second example, would I prefetch inherits_browser.js? If so, how does webpack know when to prefetch it?

EDIT: I solved my OOM issue, but I'm still curious why the analyse tool shows this.

Community
  • 1
  • 1
Andrew Chen
  • 373
  • 1
  • 7
  • 16
  • how did you solve your OOM?. I'm trying to use webpack to build a lambda deployment bundle. The problem I have is that it attempts to load and build 25467 modules and after a few minutes it runs out of memory. – Jesper Kristiansen Jan 16 '17 at 16:24
  • Sorry about the really late response. I'm not sure if my solution works for you, but what I ended up doing was reusing plugins instead of instantiating a new one every iteration of the loop. – Andrew Chen Feb 18 '17 at 06:54

0 Answers0