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

Add augmentChunkHash hook for proper content hashing #231

Merged
merged 4 commits into from Mar 6, 2020

Conversation

warlo
Copy link
Contributor

@warlo warlo commented Feb 14, 2020

Enables rollup to properly use the processed css result for content hashing through [hash] with extract: true.

augmentChunkHash allows plugins to provide content to be used for rollups hashing function, and this PR passes on a stringified version of the extracted result. Making content from sass @imports etc included in the hashing. Ref rollup/rollup#2921

The reduce logic is basically just to parse the extracted Map to an object that contains the key-value pairs.

@codecov
Copy link

codecov bot commented Feb 14, 2020

Codecov Report

Merging #231 into master will increase coverage by 0.78%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #231      +/-   ##
==========================================
+ Coverage   91.75%   92.54%   +0.78%     
==========================================
  Files           9        9              
  Lines         291      295       +4     
  Branches      102      103       +1     
==========================================
+ Hits          267      273       +6     
+ Misses         24       22       -2
Impacted Files Coverage Δ
src/index.js 98.85% <100%> (+2.42%) ⬆️
src/sass-loader.js 88.37% <0%> (-0.27%) ⬇️
src/postcss-loader.js 93.4% <0%> (+0.14%) ⬆️

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 122a092...67dd1b5. Read the comment docs.

Enables rollup to properly use processed css result for content hashing
@warlo
Copy link
Contributor Author

warlo commented Mar 1, 2020

Possible to take a look at this? @himself65 @SASUKE40

@himself65 himself65 merged commit 6f6544c into egoist:master Mar 6, 2020
@himself65
Copy link
Collaborator

thanks for your contributions🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants