Skip to content
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

fix(index): tapable deprecation warnings (webpack >= v4.0.0) #100

Merged
merged 1 commit into from
Feb 23, 2018
Merged

Conversation

ai
Copy link
Contributor

@ai ai commented Feb 23, 2018

Right now the plugin shows this warning when I try to run it with webpack 4.0.0-beta2:

DepreciationWarning: Tappable.plugin is deprecated. Use new API on `.hooks` instead

This fix will support both webpack 3 and webpack 4 APIs without any warning. This way to deal with the API is recommended by @sokra webpack-contrib/webpack-bundle-analyzer#154 (comment)

I need this PR to add .mjs support to Size Limit ai/size-limit#42

@michael-ciniawsky same as webpack-contrib/uglifyjs-webpack-plugin#238

@ai
Copy link
Contributor Author

ai commented Feb 23, 2018

@michael-ciniawsky I fix PR according to uglify plugin’s PR notices

src/index.js Outdated
};

if (compiler.hooks) {
compiler.hooks.emit.tapAsync({ name: 'compression-webpack-plugin' }, emit);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const plugin = { name: 'CompressionPlugin' };

compiler.hooks.emit.tapAsync(plugin, emit);

:)

@michael-ciniawsky michael-ciniawsky changed the title fix(index): deprecation warnings (webpack >= v4.0.0) fix(index): tapable deprecation warnings (webpack >= v4.0.0) Feb 23, 2018
@michael-ciniawsky michael-ciniawsky added this to the 1.1.8 milestone Feb 23, 2018
@michael-ciniawsky michael-ciniawsky merged commit d6ccdc4 into webpack-contrib:master Feb 23, 2018
@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 23, 2018

Released in v1.1.8 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants