项目缓存问题处理

1、public/index.html文件头部配置

<meta http-equiv="pragram" content="no-cache">

<meta http-equiv="cache-control" content="no-cache,no-store,must-revalidate">

<meta http-equiv="expires" content="0">

2、vue.config.js文件配置打包文件时间戳

//CSS类

css: {

extract: {

filename: `css/[name].${version}.css`,

chunkFilename: `css/[name].${version}.css`

}

},

//JS类

configureWebpack: {

output: {

// 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】

filename: `js/[name].${version}.js`,

chunkFilename: `js/[id].${version}.js`

}

},

3、打包呈现效果:

猜你喜欢

转载自blog.csdn.net/qq_37815596/article/details/129195562