vue cli加时间戳 解决更新服务器缓存问题
在 vue.config.js 的文件中加入下面这段话
const Timestamp = new Date().getTime(); module.exports = { configureWebpack: { // webpack 配置 output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】 config.output.filename('js/[name].' + Timestamp + '.js').end();
config.output.chunkFilename('js/[name].' + Timestamp + '.js').end();
config.plugin('extract-css').tap(args => [{
filename: `css/[name].${Timestamp}.css`,
chunkFilename: `css/[name].${Timestamp}.css` }
]) }, }, }
本文来自博客园,作者:三线码工,转载请注明原文链接:https://www.cnblogs.com/shangrao/p/15798182.html