- Notifications
You must be signed in to change notification settings - Fork 41
Webpack 4 refactor #11
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
Conversation
Codecov Report
@@ Coverage Diff @@ ## master #11 +/- ## ========================================== - Coverage 100% 98.34% -1.66% ========================================== Files 2 2 Lines 117 121 +4 Branches 5 6 +1 ========================================== + Hits 117 119 +2 - Misses 0 2 +2
Continue to review full report at Codecov.
|
AnujRNair left a comment
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.
Hi @ScottRocha!
Thanks for contributing to this project!
I've added a few comments for your consideration
| ); | ||
| }); | ||
| } else { | ||
| compiler.plugin('compilation', compilation => { |
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.
Would you be able to reduce the code duplication here? Abstracting the main body of the compilation step out would help keep test coverage of the entire project high, and would be better for maintainability
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.
Can do. Give me a few.
plugin.js Outdated
| if (!this.isEnabled(htmlPluginData)) { | ||
| $('meta[http-equiv="Content-Security-Policy"]').remove(); | ||
| if (compiler.hooks) { | ||
| compiler.hooks.compilation.tap('HtmlWebpackHarddisk', compilation => { |
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.
HtmlWebpackHarddisk should be updated to CspHtmlWebpackPlugin
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.
This has been updated in the latest commit.
plugin.js Outdated
| if (compiler.hooks) { | ||
| compiler.hooks.compilation.tap('HtmlWebpackHarddisk', compilation => { | ||
| compilation.hooks.htmlWebpackPluginAfterHtmlProcessing.tapAsync( | ||
| 'HtmlWebpackHarddisk', |
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.
This should also be updated to match the plugin name
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.
This has also been updated in the latest commit.
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.
@AnujRNair I have implemented the changes as requested. Let me know if there is anything else blocking this from being approved.
AnujRNair left a comment
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 for the contribution!
Summary
Implement Webpack 4 hooks API.
Requirements (place an
xin each[ ])