Skip to content

Commit

Permalink
feat(webpack.prod): generate a manifest file
Browse files Browse the repository at this point in the history
Separating JS bundles allow to improve caching. Example: If vendors
files changed, the manifest file doesn’t need to be downloaded again to
the client. Ref: https://github.com/manavsehgal/reactspeedcoding
  • Loading branch information
kiki-le-singe committed Sep 1, 2016
1 parent 8b70740 commit b86de24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webpack/prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const config = {
output: {
path: paths('dist'),
filename: '[name]-[hash].js',
chunkFilename: '[chunkhash].js',
publicPath: '/dist/'
},
resolve: {
Expand Down Expand Up @@ -133,7 +134,9 @@ const config = {
comments: false
}
}),
new webpack.optimize.CommonsChunkPlugin('vendors', '[name].[hash].js'),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
}),

webpackIsomorphicToolsPlugin
]
Expand Down

0 comments on commit b86de24

Please sign in to comment.