修改build/webpack.prod.conf.js路径里的文件
代码语言:javascript复制const version = new Date().getTime();
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash:8].' version '.js'),
chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].' version '.js')
},
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing' ?
'index.html' :
config.build.index,
template: 'index.html',
inject: true,
hash: version,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
在index.html页面
代码语言:javascript复制 <meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
<meta name="viewport" content="width=device-width,initial-scale=1.0">