mattkrick / meatier

:hamburger: like meteor, but meatier :hamburger:
3.05k stars 173 forks source link

fingerprint css? #140

Open wenzowski opened 8 years ago

wenzowski commented 8 years ago

The javascript chunking configuration currently uses [name]_[chunkhash].js as filename, which makes it easy to permanently cache the chunk: if its contents change its name changes as well.

Currently we have a single prerender.css. What would it take to do the same thing with css chunks?

followup to #139

mattkrick commented 8 years ago

oh wow, exactly my thoughts after reading #139. Yeah, let's just chunkhash the css file. Although fair warning, I'm thinking about doing away with stylesheets in the future, so I'm not sure if it's worth the effort. For future reference though:

  1. add in a chunkhash on the filename
  2. add the AssetsPlugin to the webpack server config, set it to serve a new file, eg serverAssets.json
  3. grab the css from serverAssets & inject it into the HTML (currently it's hardcoded to prerender.css)
wenzowski commented 8 years ago

I thought something like that might be in the works.

Thanks for the instructions. If I get to that change before you ditch the stylesheet I'll send a PR.