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
migration for webpack4's hooks API #132
Conversation
I will add the old code to support '<4' version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @getElementsByName , this is a valuable change. Sorry for leaving it so long.
Unfortunately there is some changes required to pass code coverage.
I'll recreate the branch myself to get this change in.
@@ -224,4 +224,20 @@ function legacyArgsToOptions(entry, paths, locals, globals) { | |||
}; | |||
} | |||
|
|||
function addThisCompilationHandler(compiler, callback) { | |||
if(compiler.hooks) { | |||
compiler.hooks.thisCompilation.tap('static-site-generator-webpack-plugin', callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately coveralls will be unhappy that this line is not being tested.
To test it would require multiple versions of webpack which may get complicated.
For now I suggest we just ignore the line.
compiler.hooks.thisCompilation.tap('static-site-generator-webpack-plugin', callback); | |
/* istanbul ignore next */ | |
compiler.hooks.thisCompilation.tap('static-site-generator-webpack-plugin', callback); |
|
||
function addOptimizeAssetsHandler(compilation, callback) { | ||
if(compilation.hooks) { | ||
compilation.hooks.optimizeAssets.tapAsync('static-site-generator-webpack-plugin',callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above:
compilation.hooks.optimizeAssets.tapAsync('static-site-generator-webpack-plugin',callback); | |
/* istanbul ignore next */ | |
compilation.hooks.optimizeAssets.tapAsync('static-site-generator-webpack-plugin',callback); |
Duplicated and merged with #139 |
No description provided.