kentcdodds / es6-todomvc

The vanillajs example converted to es6
https://kcd.im/webpack-workshop-repo
MIT License
351 stars 358 forks source link

CommonsChunkPlugin needs to specify manifest for LT Caching #18

Closed wlingke closed 8 years ago

wlingke commented 8 years ago

In the https://github.com/kentcdodds/es6-todomvc/blob/lesson/hashing-chunks, you demonstrate how to do hashing with chunks. However, from what I understand, you need to specify a manifest with the commons chunk plugin. Otherwise, if you change the application code, the hash for the vendor file will change too even if you make no changes to the vendor file.

This guide explains it better than I can: http://survivejs.com/webpack/building-with-webpack/splitting-bundles/

kentcdodds commented 8 years ago

You are correct. Here's a working version: https://github.com/kentcdodds/es6-todomvc/tree/FEM/06.1-longterm-caching

Here's the diff that shows the main stuff that needs to change to make this happen: https://github.com/kentcdodds/es6-todomvc/compare/FEM/06.0-commons-chunk...FEM/06.1-longterm-caching

Good luck!