-
-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 4 outputs deprecation warnings #154
Comments
Hi, and thanks for raising an issue! So to clarify, The deprecation warning is a result of this line:
Do you have an idea of how a plugin can support both webpack 3 and 4 at the same time without outputting deprecation warnings? |
Yeap :)
In the same cases, I used this method: if (compiler.hooks) {
// Webpack >= 4
} else {
// Webpack < 4
} But I am not 100% sure about this case. |
Should be pretty easy to do that :). Would you be open to trying this approach out with webpack 4? https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/master/CONTRIBUTING.md has intructions on how to setup the build pipeline for this project and link to your own project for local testing. Or maybe @jaydenseric would like to give this a try if you've got time? |
@valscion sure, if nobody closes it until Friday, I will try to fix (Friday is my open source day =^_^=). |
👍 thanks! I noticed that CONTRIBUTING.md still has a mention of |
@valscion better do major release than use |
@evilebottnawi if you will do major release all next Bundle Analyzer releases will be unavailable for Webpack 3 users |
If possible @evilebottnawi, I'd rather support both webpack 3 and 4. We only use the |
@evilebottnawi is there a recommended way to support both Webpack 4 and 3 APIs? @sokra? |
|
you can do the following: if(compiler.hooks) {
compiler.hooks.done.tap(...);
} else {
compiler.plugin(...);
} |
Ah, but if we'd rather have the code to be optimal for webpack 4 and if it is simple and straightforward to do so, it might make more sense than adding special flags. The piece of code @sokra posted above is what I'd accept as a PR. |
Fixed in v2.10.1 🎉, thanks @ai for the pull request! |
Issue description
Using
webpack-bundle-analyzer
with Webpack 4:Technical info
Debug info
How do you use this module? As CLI utility or as plugin?
Plugin inside Size Limit
If plugin, what options were provided? (e.g.
new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)What other Webpack plugins were used?
compression-webpack-plugin
anduglifyjs-webpack-plugin
Related issue: ai/size-limit#42
The text was updated successfully, but these errors were encountered: