解决 vuejs 打包时缓存问题
index.html
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
vue.config.js
const Timestamp = new Date().getTime()
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
outputDir: 'dist',
configureWebpack: config => {
config.output.filename = `[name].${process.env.NODE_ENV}.${Timestamp}.js`
config.output.chunkFilename = `[name].${process.env.NODE_ENV}.${Timestamp}.js`
},
css: {
extract: {
filename: `css/[name].${process.env.NODE_ENV}.${Timestamp}.vw.css`,
chunkFilename: `css/[name].${process.env.NODE_ENV}.${Timestamp}.vw.css`
}
}
}
打包效果
