Skip to content

Commit bc42a42

Browse files
committed
Add hash to vendor bundle in production
1 parent c8ef125 commit bc42a42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

webpack/base.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import IsomorphicPlugin from 'webpack-isomorphic-tools/plugin';
66
import { OUTPUT_PATH, ASSET_HOST, RESOLVE_PATHS } from './constants';
77

88
const isDev = process.env.NODE_ENV === 'development';
9+
const isProd = process.env.NODE_ENV === 'production';
910
const isomorphicPlugin = new IsomorphicPlugin(isomorphicConfig).development(isDev);
1011

1112
export default {
@@ -78,7 +79,7 @@ export default {
7879
}),
7980
new webpack.optimize.CommonsChunkPlugin({
8081
name: 'vendor',
81-
filename: 'vendor.js',
82+
filename: `vendor${isProd ? '.[hash]' : ''}.js`,
8283
minChunks: Infinity
8384
})
8485
]

0 commit comments

Comments
 (0)