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

DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead #225

Closed
fregante opened this issue Feb 8, 2018 · 13 comments

Comments

@fregante
Copy link

fregante commented Feb 8, 2018

I'm using with copy-webpack-plugin 4.4.1 with webpack 4.0.0-beta.0 and I get this warning (although it seems to work since #211)

@alexander-akait
Copy link
Member

@bfred-it expected behavior, will be fixed in next major, after webpack@4 will be official release

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 8, 2018

This will stay for a while since the plugin needs to support webpack =< v4.0.0 and webpack 4 has a compat layer for the 'old' plugin system

@michael-ciniawsky michael-ciniawsky added this to the 5.0.0 milestone Feb 8, 2018
@alexander-akait
Copy link
Member

@michael-ciniawsky in theory we can check on new api and use new api

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 8, 2018

This is handled by the compat layer in webpack imho. A option/flag to disable the warnings would be awesome, but this should also happen in webpack/webpack instead

@alexander-akait
Copy link
Member

@michael-ciniawsky --ignore-deprecation for webpack will be good

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 8, 2018

Yep, something like that or a sledgehammers --silent [...options] mode, since webpack can be quite noisy in general sometimes (e.g loader warnings per file/request) :)

@julkue
Copy link

julkue commented Feb 25, 2018

Webpack 4 is now available.

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 25, 2018

Someone can send PR which feature detects webpack >= v4.0.0 via

const cb = (...args) => {}

...

if (compiler.hooks) {
  const plugin = { name: 'CopyPlugin' }
 
  compiler.hooks.someHook.tap(plugin, cb)
} else {
  compiler.plugin('some-hook', cb)
}

@laozhu
Copy link

laozhu commented Mar 1, 2018

Webpack 4 supported?

@alexander-akait alexander-akait modified the milestones: 5.0.0, 4.4.3 Mar 1, 2018
@alexander-akait
Copy link
Member

Let's do it in next patch. WIP

@alexander-akait
Copy link
Member

Done #234

@michael-ciniawsky
Copy link
Member

Released in v4.4.3 🎉

@puppeteer701vungle
Copy link

I am getting this issue with version 4.6.0 and webpack 4.27.0.

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

No branches or pull requests

6 participants