umi项目打包后还是使用上一个版本,存在缓存
在项目config.ts或.umirc.ts 内写上metas配置:
metas: [
{
httpEquiv: 'Cache-Control',
content: 'no-cache',
},
{
httpEquiv: 'Pragma',
content: 'no-cache',
},
{
httpEquiv: 'Expires',
content: '0',
},
],
打包后会在index.html中生成如下
后面发现这样还是会有缓存
在项目config.ts或.umirc.ts 配置hash:
hash:true
这样打包后会在js和css加上hash版本号,就不会有缓存了