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

Use webpack-4 style hooks. #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mark-raymond
Copy link

@mark-raymond mark-raymond commented Nov 19, 2018

compiler.plugin is deprecated in webpack 4. This PR uses the new way of hooking into webpack, fixing #32.

Context: I upgraded to webpack 4 today, and got this warning:

(node:8980) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
    at InjectByTag.apply (<source path>\node_modules\webpack-auto-inject-version\dist\WebpackAutoInjectVersion.js:3468:29)
    at WebpackAutoInject._executeComponent (<source path>\node_modules\webpack-auto-inject-version\dist\WebpackAutoInjectVersion.js:2879:12)
    at WebpackAutoInject._executeComponent (<source path>\node_modules\webpack-auto-inject-version\dist\WebpackAutoInjectVersion.js:2871:14)
    at WebpackAutoInject._executeWebpackComponents (<source path>\node_modules\webpack-auto-inject-version\dist\WebpackAutoInjectVersion.js:2844:12)
    at WebpackAutoInject.apply (<source path>\node_modules\webpack-auto-inject-version\dist\WebpackAutoInjectVersion.js:2817:12)
    at webpack (<source path>\node_modules\webpack\lib\webpack.js:47:13)
    at Object.<anonymous> (C:\Work\Git\SqlClone\RedGate.SqlClone.Client.Web\tools\build.js:14:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

I guess this would make webpack-auto-inject-version incompatible with webpack 3 and earlier; I'm not sure what the best way of dealing with that is.

@bndynet
Copy link

bndynet commented Dec 10, 2018

@mark-raymond I'm glad to find your PR, but did not work. Maybe I have some package dependencies problems. So I try to write a simple plugin for latest webpack at https://github.com/bndynet/header-injection-webpack-plugin, it worked. Thanks for your PR which gives me some helps.

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

Successfully merging this pull request may close these issues.

2 participants