-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Feature: Immutable build #172
Conversation
We should pull some people in regarding the hashing, I think it has kinda wild implications for ServiceWorkers. |
I'm not sure but never see anyone hash ServiceWorker runtime, just be sure to set the right HttpCache on your server. |
You mean for |
@rkostrzewski Pinging the tests guy. Since filename is changing between builds, we can't compare the assets anymore |
We could take a page from CRA and strip the hashes from filenames prior to doing the comparison |
Yup. That, or look for exact match else regex match. |
@developit if that is the case, I'll wait for #162 before fix the tests |
@@ -220,7 +220,7 @@ export default (env) => { | |||
// produce HTML & CSS: | |||
addPlugins([ | |||
new ExtractTextPlugin({ | |||
filename: 'style.css', | |||
filename: isProd ? "style.[contenthash:5].css" : "style.css", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the idea on client, not so on server side. I'd much prefer to have static file on server for critical css inlining.
I think we should pass an argument to webpack-base-config
from webpack-client-config
and webpack-server-config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option is to expose a mainfest.json
which would be used to resolving filenames from entries (dunno how this works - only seen folks doing that)
@thangngoc89 I'll merge the tests fix and add regex matching - that sounds cool 😎 |
Travis build failed because it got different hashes than on my local env. This could break long term hashing. Different hashes = some code is undeterministic (i.e. relies on env it was built on). My bet is that this line produced this output. |
@rkostrzewski it's not just that line, a lot of things need to to config to support long term caching |
@thangngoc89 ok I've found what's the issue here. Entrypoint relative path changes on travis because of different way |
@rkostrzewski I'm suggesting that we keep this PR as starting point for immutable build. ANd send another PR for adding Long term caching support. (keep the hashes consistent between builds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. However, I'd like someone to review changes to async-component-loader
& tests stuff as I've made them 😜
weight: 0.9 | ||
} | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed those spaces for you 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rkostrzewski Thx. That's usually prettier's job
@lukeed @developit It's good for your review |
I'll review this tonight 🙏 |
I'm pushing this here to get the ideas first, will fix test later
With this change, only
index.html
andsw.js
is mutable between builds.Fixes #23
Blocked by #162