build: use contenthash in output filename for better caching

This commit is contained in:
Haishan 2018-10-24 00:05:51 +08:00
parent 3aa50333dc
commit f18817bf55

View file

@ -30,7 +30,8 @@ const entry = {
const output = {
path: path.resolve(__dirname, 'public'),
filename: isDev ? '[name].bundle.js' : '[name].[chunkhash].js',
// use contenthash instead of chunkhash to take advantage of caching
filename: isDev ? '[name].bundle.js' : '[name].[contenthash].js',
publicPath: ''
};