Files
Hfive/vue.config.js
2024-05-22 14:31:07 +08:00

22 lines
875 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
if (process.env.UNI_PLATFORM === 'h5') {
// 由于这种方式的打包,会导致编译生成微信小程序(只验证了微信小程序)无法正常使用,所以必须分开
let filePath = ''
let Timestamp = new Date().getTime()
module.exports = {
// ... webpack 相关配置
filenameHashing: false,
configureWebpack: { // webpack 配置 解决js缓存的问题目前只适配H5端打包
output: { // 输出重构 打包编译后的 文件目录 文件名称 【模块名称.时间戳】
filename: `${filePath}[name].js?v=${Timestamp}`,
chunkFilename: `${filePath}[name].js?v=${Timestamp}`
},
}
}
} else {
// 其他打包需要的相关配置
//由于vue-cli打包vue文件的时候静态文件会默认会带有hash值我们首先要去掉hash值。
module.exports = {
// ... webpack 相关配置
filenameHashing: false
}
}