Add support for Webpack's BannerPlugin
#601
Replies: 1 comment
-
We are having a similar issue when using the Sentry Webpack plugin, which injects a script to the top of the bundle using !function(){ /* Sentry code here */ }(),(()=>{ /* webpack module here */})(); When walking the AST in This in turn means that There's an example at https://github.com/jameshoward/webpack-sentry-demo but an even simpler reproduction is to inject code with a // webpack.config.js
…
plugins: [
new webpack.BannerPlugin({
banner: '(function() { console.log(window); })();',
raw: true
})
] |
Beta Was this translation helpful? Give feedback.
-
Adding the following
BannerPlugin
to a build:causes webpack-bundle-analyzer not to return an accurate size. This is because when webpack-bundle-analyzer parses a bundle it requires the first thing in the bundle to be the start of a webpack module. It would be great if the parsing logic could be changed to take this plugin into account.
Beta Was this translation helpful? Give feedback.
All reactions