vue.config.js 649 B

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