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

Tapable.plugin is deprecated. Use new API on `.hooks` instead (au build / webpack 4.x ) #923

Closed
oising opened this Issue Sep 27, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@oising

oising commented Sep 27, 2018

The offending line is:

compiler.plugin('done', () => done());

Rewriting as:

function buildWebpack(done) {
  if (CLIOptions.hasFlag('watch')) {
    compiler.watch({}, onBuild);
  } else {
    compiler.run(onBuild);
    //compiler.plugin('done', () => done()); // Tapable.plugin is deprecated. Use new API on `.hooks` instead
    compiler.hooks.done.tap('done', () => done());
  }
}

This removes the deprecation warning. Sorry I can't offer a PR, but I know little about webpack internals or the aurelia-cli -- I just dug enough to fix this issue. Again, I think this only rears its ugly head with webpack 4.x

@oising oising changed the title from Tapable.plugin is deprecated. Use new API on `.hooks` instead (webpack 4.x) to Tapable.plugin is deprecated. Use new API on `.hooks` instead (au build / webpack 4.x ) Sep 27, 2018

huochunpeng added a commit to huochunpeng/cli that referenced this issue Oct 14, 2018

fix(webpack): use webpack4 hook that replaced deprecated plugin api
Thanks @oising for the fix. @jods recommended using a meaningful hook name.

closes aurelia#923

huochunpeng added a commit to huochunpeng/cli that referenced this issue Oct 14, 2018

fix(webpack): use webpack4 hook that replaced deprecated plugin api
Thanks @oising for the fix. @jods recommended using a meaningful tap name.

closes aurelia#923

huochunpeng added a commit to huochunpeng/cli that referenced this issue Oct 14, 2018

fix(webpack): use webpack4 hook that replaced deprecated plugin api
Thanks @oising for the fix. @jods4 recommended using a meaningful tap name.

closes aurelia#923

huochunpeng added a commit to huochunpeng/cli that referenced this issue Oct 14, 2018

fix(webpack): use webpack4 hook that replaced deprecated plugin api
Thanks @oising for the fix. @jods4 recommended using a meaningful tap name.

closes aurelia#923
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment