Closed jameshoward closed 1 year ago
Thanks for opening this issue! This looks similar to the feature request here: https://github.com/webpack-contrib/webpack-bundle-analyzer/discussions/601 — that is, we don't currently support BannerPlugin
.
Could you share your details in #601 and close this issue? Let's keep the feature request discussion in the same place ☺️
Yes, sorry, I'll add a comment to the FR. I had checked through the issues to make sure I wasn't duplicating one but didn't think to check the feature requests. Thanks.
Yeah no worries! I haven't done much work directing people to discussions so it's easy to miss ☺️
Issue description
We have begun using the Sentry Webpack plugin, which injects a small script at the top of the bundle output. This seems to break the
parseBundle
function inparseUtils.js
because, after minification, the bundle ends up starting like this:When walking the AST in
parseBundle
, this is matched as a singleExpressionStatement
but it doesn't match any of the conditions for finding the Webpack module.This in turn means that
node_modules
are not correctly split out from thesrc
in our project when using this plugin.There's an example at https://github.com/jameshoward/webpack-sentry-demo but an even simpler reproduction is to inject code with a
BannerPlugin
, provided that code won't be overly-stripped-out by Terser:Also raised as https://github.com/getsentry/sentry-javascript-bundler-plugins/issues/335 in case it could be fixed their side.
Technical info
Debug info
Used as a CLI with
webpack-bundle-analyzer stats.json dist/