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

Use webpack chunkhash to enable long-term caching #597

Merged
merged 2 commits into from
Nov 3, 2016

Conversation

jeffcarbs
Copy link
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
Member

arunoda commented Nov 3, 2016

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

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