0
我缩小并协调供应商文件。将vendor.min.js中的脚本与一些信息(如原始文件名)分开将会很好。我正在使用gulp-header将标题添加到我的输出文件。如何将当前源文件名添加到gulp-header
// Minify vendor JS
gulp.task('minify-vendor-js', function() {
return gulp.src([
'lib/**/*.js'
])
.pipe(uglify())
.on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); })
.pipe(header("// Vendor Package (compressed) - all rights reserved to the respective owners\r\n"))
.pipe(concat('vendor.min.js'))
.pipe(gulp.dest('js'))
});
vendor.min.js应该是这样的(注意是“压缩从...”标题:
// compressed from jquery.js
!function(e,t){"object"==typeof module&&"object"==typeof module.exports?mod ...
// compressed from bootstrap.js
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript ...
我怎样才能得到当前gulp.src文件名到标题文本?