Skip to content

Conversation

@AnujRNair
Copy link
Contributor

Summary

Currently, if you pull in the manifest asset, it's children are defined as all of the other assets in the build.
This causes the plugin to hash all assets in the build, rather than only the smaller subset that the developer has defined using the cspAssetRegex option.

This change ignores the children of the manifest asset when recursively iterating through the assets to hash

Requirements (place an x in each [ ])

@codecov-io
Copy link

Codecov Report

Merging #4 into master will decrease coverage by 0.59%.
The diff coverage is 80%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #4 +/- ## ======================================== - Coverage 96.4% 95.8% -0.6%  ======================================== Files 2 2 Lines 139 143 +4 Branches 17 19 +2 ======================================== + Hits 134 137 +3  - Misses 5 6 +1
Impacted Files Coverage Δ
plugin.js 94.25% <80%> (-0.93%) ⬇️

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 5db58f8...1d0acec. Read the comment docs.

}

// if the chunk size is 0 right now, it's probably the empty manifest chunk - let's mark it as such
if (chunk.size === 0) {

Choose a reason for hiding this comment

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

It'd be great if there were a more official way of detecting this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed - Looking through CommonsChunkPlugin and webpack-manifest-plugin, I can't see a good way to detect that the chunk is the manifest chunk. If this becomes problematic, I will certainly look for a better way to detect this

@slackhq slackhq deleted a comment from rowanoulton Jan 19, 2018
Copy link

@rowanoulton rowanoulton left a comment

Choose a reason for hiding this comment

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

LGTM

@AnujRNair AnujRNair merged commit 1e82679 into master Jan 19, 2018
@AnujRNair AnujRNair deleted the an-ignore-manifest-children branch January 19, 2018 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants