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

Deprecation warning with webpack 4 #22

Open
tzimmermann opened this issue Mar 23, 2018 · 3 comments · May be fixed by #31 or #34
Open

Deprecation warning with webpack 4 #22

tzimmermann opened this issue Mar 23, 2018 · 3 comments · May be fixed by #31 or #34

Comments

@tzimmermann
Copy link

Usingwebpack 4.1.1, I get this warning during webpack build:

(node:40693) DeprecationWarning: Tapable.plugin is deprecated. Use new API on.hooksinstead

With help of webpack/webpack#6568 (comment), I was able to trace the culprit to being the unused-files-webpack-plugin:

at UnusedFilesWebpackPlugin.apply (/Users/tz-mac/Repos/pex-client/node_modules/unused-files-webpack-plugin/lib/index__8.0.0__.js:105:14) at webpack (/Users/tz-mac/Repos/pex-client/node_modules/webpack/lib/webpack.js:37:12)

which refers to this line:

compiler.plugin(`after-emit`, (compilation, done) =>

jquense added a commit to jquense/unused-files-webpack-plugin that referenced this issue May 10, 2018
@oising
Copy link

oising commented Sep 27, 2018

Yeah, I had a similar issue in a build.ts used in the aurelia-cli build tasks. I know nothing about webpack internals, but I figured out enough to switch from using compiler.plugin('done', ...) to compiler.hooks.done.tap('done', ...) Your mileage may vary. Here's my code in context:

function buildWebpack(done) {
  if (CLIOptions.hasFlag('watch')) {
    compiler.watch({}, onBuild);
  } else {
    compiler.run(onBuild);
    //compiler.plugin('done', () => done());
    compiler.hooks.done.tap('done', () => done());
  }
}

@oising
Copy link

oising commented Sep 27, 2018

fyi, there is a compiler.hooks.afterEmit hook ;)

@SonyaOrlova SonyaOrlova linked a pull request Apr 15, 2019 that will close this issue
@Akiyamka
Copy link

Akiyamka commented Aug 8, 2019

Any chance this will be fixed?

@neilkuumar neilkuumar linked a pull request Mar 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants