Skip to content

Use webpack chunkhash to enable long-term caching#597

Merged
arunoda merged 2 commits intostorybookjs:masterfrom
jeffcarbs:feature/webpack-chunk-hash
Nov 3, 2016
Merged

Use webpack chunkhash to enable long-term caching#597
arunoda merged 2 commits intostorybookjs:masterfrom
jeffcarbs:feature/webpack-chunk-hash

Conversation

@jeffcarbs
Copy link
Copy Markdown
Contributor

@jeffcarbs jeffcarbs commented Nov 2, 2016

Fixes #372

Use chunkhash in the output filenames to enable long-term caching.

Note: This was originally #594 but was closed. I updated it and am re-opening. @arunoda you mentioned that caching already exists via #578, however given that this project is already using webpack I'd think it's better to use the built-in webpack caching feature vs the "old way" of appending a random cachebuster.

This PR also fixes a bug with some assets were not being included in the iframe.html. My compiled CSS was never being output, I think it may have something to do with the fact that I'm using the ExtractTextPlugin which automatically hashes my CSS file using chunkhash. After this PR, my preview.css is output into the iframe.html.

NOTE: This bugfix wouldn't be possible with the cachekey method since you need to parse webpack's output to get the hashed filename.

@arunoda arunoda merged commit bc2cc48 into storybookjs:master Nov 3, 2016
@arunoda
Copy link
Copy Markdown
Member

arunoda commented Nov 3, 2016

Thanks. This makes sense.
I also had to apply these changes for server/middleware.js as well.

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Jun 23, 2025

View your CI Pipeline Execution ↗ for commit bc2cc48

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 56s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-29 16:32:24 UTC

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.

3 participants