Skip to content

Conversation

@ScottRocha
Copy link
Contributor

@ScottRocha ScottRocha commented Mar 21, 2018

Summary

Implement Webpack 4 hooks API.

Requirements (place an x in each [ ])

@codecov-io
Copy link

codecov-io commented Mar 21, 2018

Codecov Report

Merging #11 into master will decrease coverage by 1.65%.
The diff coverage is 90.47%.

Impacted file tree graph

@@ 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
Impacted Files Coverage Δ
plugin.js 95.91% <90.47%> (-4.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85a8543...b2b4a58. Read the comment docs.

Copy link
Contributor

@AnujRNair AnujRNair left a 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 => {
Copy link
Contributor

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

Copy link
Contributor Author

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 => {
Copy link
Contributor

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

Copy link
Contributor Author

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',
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

@ScottRocha ScottRocha left a 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.

Copy link
Contributor

@AnujRNair AnujRNair left a 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!

@AnujRNair AnujRNair merged commit 273b6d0 into slackhq:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants