2017-09-05 59 views

回答

0

我已經解決了這兩個事情的組合: gulp-renamegulp-inject

.pipe(rename('main-' + Math.floor(Date.now()/1000) + '.min.js')) 
... 

and then 


var target = gulp.src('./index.html'); 
var sources = gulp.src(['./dev/js/*.js'], {read: false}); 

return target.pipe(inject(sources, {relative: true})) 
    .pipe(gulp.dest('.')); 

看看這兩個庫。其他選項並不實用。