解决vue cli3.x打包更新版本,浏览器缓存问题

<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
在 vue.config.js 的文件中加入下面这段话

// vue.config.js
const Timestamp = new Date().getTime();
module.exports = {
  configureWebpack: { // webpack 配置
    output: { // 输出重构  打包编译后的 文件名称  【模块名称.版本号.时间戳】
      filename: `[name].${process.env.VUE_APP_Version}.${Timestamp}.js`,
      chunkFilename: `[name].${process.env.VUE_APP_Version}.${Timestamp}.js`
    },
  },
...
}

猜你喜欢

转载自blog.csdn.net/diaojw090/article/details/107971805