Skip to content

add support for webpack's new contenthash support #59

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

Merged
merged 3 commits into from
Mar 28, 2018
Merged

Conversation

sokra
Copy link
Member

@sokra sokra commented Mar 27, 2018

fixes #1

src/index.js Outdated
if (typeof contentHash[chunkId] === 'string') {
shortContentHashMap[chunkId] = contentHash[
chunkId
].substr(0, length);
Copy link
Contributor

@Jessidhia Jessidhia Mar 27, 2018

Choose a reason for hiding this comment

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

.slice or .substring? .substr is Annex B so it'd be better to avoid it entirely.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change it to substring.

@@ -0,0 +1 @@
.wX52cuPepLZcpDx5S3yYO { background: red; }
Copy link
Contributor

Choose a reason for hiding this comment

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

The double hashes in the filename look scary 🤔

I assume that actual users will want to use [contenthash] only instead of both [contenthash] and [chunkhash]

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes of course, this is just a test which tests both

@bebraw bebraw mentioned this pull request Mar 27, 2018
@codecov
Copy link

codecov bot commented Mar 28, 2018

Codecov Report

Merging #59 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@         Coverage Diff          @@
##           master   #59   +/-   ##
====================================
  Coverage       0%    0%           
====================================
  Files           3     3           
  Lines         157   180   +23     
  Branches       32    39    +7     
====================================
- Misses        125   141   +16     
- Partials       32    39    +7
Impacted Files Coverage Δ
src/index.js 0% <0%> (ø) ⬆️

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 2456895...7b56927. Read the comment docs.

@sokra sokra merged commit 2899ed3 into master Mar 28, 2018
@sokra sokra deleted the feature/contenthash branch March 28, 2018 07:26
@sokra
Copy link
Member Author

sokra commented Mar 28, 2018

Thanks for reviewing @Kovensky

@Cryrivers
Copy link

Could we have a release or prerelease for this?

@bebraw
Copy link

bebraw commented Mar 30, 2018

@Cryrivers There's a stable version now. Make sure to run a recent version of webpack for it to work.

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.

Content hash support
4 participants