1234567891011121314151617 |
- let filePath = ''; // 默认文件路径
- let TimeStamp = ''; // 时间戳
- // let Version = '-V2.0.0-'; // 版本号
- //编译环境判断,可以根据不同环境来做相应的配置
- if (process.env.UNI_PLATFORM === 'h5') {
- filePath = 'static/js/'
- TimeStamp = new Date().getTime();
- }
- module.exports = {
- configureWebpack: {
- output: { // filePath: 路径 name: 默认文件名 Version: 版本号 TimeStamp: 时间戳; 重构文件名
- filename: `${filePath}[name]${TimeStamp}.js`, // static/js/index-V2.0.0-1623123456789.js
- chunkFilename: `${filePath}[name]${TimeStamp}.js` // static/js/pages-home-index-V2.0.0-1623123456789.js
- },
- },
- }
|