Skip to content

Added documentation for [contenthash] #6839 #2085

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 8 commits into from
Aug 3, 2018

Conversation

FadySamirSadek
Copy link
Member

Added output file name example for the new introduced [contenthash]

Copy link
Member

@montogeek montogeek left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -213,6 +214,12 @@ Using hashes based on each chunks' content:
filename: "[chunkhash].bundle.js"
```

Using hashes generated for extracted content :
Copy link
Member

Choose a reason for hiding this comment

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

No space before colon

@FadySamirSadek
Copy link
Member Author

@dhruvdutt @montogeek I applied the requested changes but there is an unrelated error in the scripts that is breaking the build and I believe it will do the same for all new PRs

@@ -213,6 +214,12 @@ Using hashes based on each chunks' content:
filename: "[chunkhash].bundle.js"
```

Using hashes generated for extracted content:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is extracted content just content generated by eg mini-css-extract-plugin or does it include all other content (eg JS bundles) too? How does it differ from chunkhash?

Copy link
Member Author

@FadySamirSadek FadySamirSadek Apr 30, 2018

Choose a reason for hiding this comment

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

chunkhash is calculated for a chunk (an entry file) while content hash is a special hash generated by eg mini-css-extract-plugin and is calculated for extracted content only not the whole chunk content. This is very useful in the case of mini-css-extract-plugin as when the extracted css is changed the css hash only is invalidated not the entire chunk.
did not want to add all these extra info here but will create a PR and add it with an example in https://webpack.js.org/guides/caching/#output-filenames as per your issue

@montogeek
Copy link
Member

@FadySamirSadek Can you add a note regarding #2096 ?

@montogeek montogeek merged commit 3963d8c into webpack:master Aug 3, 2018
@montogeek
Copy link
Member

Thanks!

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.

4 participants