I'm code splitting vendor and app into chunks via CommonsChunkPlugin
. When I build twice I expect the vendor chunk to be unchanged, but it changes :(
Steps to replicate:
- Clone https://github.com/mattcolman/webpack-vendor-chunk-test
- Run
yarn
, thenyarn analyzeBundle
, thenyarn analyzeBundle
again. - Notice the vendor chunk hash has changed.
The diff between the 2 bundles shows that the TIME_STAMP
I provide via the DefinePlugin
is ending up in the vendor chunk, however this code is always inside a code block checking for "development" === 'test'
, so I would have thought this code gets removed on production.
I actually expected the code for injecting TIME_STAMP
would end up in the app bundle, that would be fine, but it's not the case.
Any help would be appreciated! Thanks in advance!