whybundled
whybundled copied to clipboard
Webpack 5 Support
This package does not support the stats file that webpack 5 creates and errors with the following:
❯ npx whybundled webpack-stats/webpack-stats.json
(stats.chunks || []).forEach is not a function
I'm making this issue to track the problem publicly, but I don't have the time right now to contribute the fix.
It is also possible that my stats are messed up because I had certain outputs set to false. Would be helpful to at least catch this error if chunks
are false
like in my case and then notify the user to check their webpack config.
Thank you for raising this. Could you please attach the stats file?
I'll have to make a public repro that isn't with my company's code, but basically https://github.com/d4rkr00t/whybundled/blob/master/lib/normalize-stats.ts#L7 should not assume an array as chunks
(even though webpack docs say that... annoying). In our case the entry
is the first object in a map lookup and then that has the array you want. I'll have to try and make a repro to post here in my free time.