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

migration for webpack4's hooks API #132

Closed

Conversation

getElementsByName
Copy link

No description provided.

@coveralls
Copy link

coveralls commented Jun 7, 2018

Coverage Status

Coverage decreased (-1.7%) to 98.276% when pulling 7e686eb on getElementsByName:master into 09001fe on markdalgleish:master.

@getElementsByName
Copy link
Author

I will add the old code to support '<4' version.

Copy link
Collaborator

@jahredhope jahredhope left a 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);
Copy link
Collaborator

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.

Suggested change
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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above:

Suggested change
compilation.hooks.optimizeAssets.tapAsync('static-site-generator-webpack-plugin',callback);
/* istanbul ignore next */
compilation.hooks.optimizeAssets.tapAsync('static-site-generator-webpack-plugin',callback);

@jahredhope
Copy link
Collaborator

Duplicated and merged with #139
Released with v3.4.2
Please reply if this was closed in error.

@jahredhope jahredhope closed this Nov 19, 2018
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.

None yet

3 participants