测试
This commit is contained in:
22
vue.config.js
Normal file
22
vue.config.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user