urllib2
在此
var isA=true;
var isB=true;
var ASources = gulp.src([srcFolder + '/app/A/'+ client + '.js'], {read: false});
var BSources = gulp.src([srcFolder + '/app/B/'+ client + '.js'], {read: false});
var transformPathA = {
transform: function (filepath) {
return '<script type="text/javascript" src="${requestScope.contextRoot}/' + FolderName + '/A.js"></script>';
}
}
var transformPathB = {
transform: function (filepath) {
return '<script type="text/javascript" src="${requestScope.contextRoot}/' + FolderName + '/BSources.js"></script>';
// Use the default transform as fallback:
//return inject.transform.apply(inject.transform, arguments);
}
}
return gulp.src ( [srcFolder + '/app/*.jsp', srcFolder + '/app/*.jsp'] )
.pipe(gulpif(isA, inject(ASources, transformPathA)))
.pipe(gulpif(isB, inject(BSources, transformPathB)))
} );
如果我执行第二次.pipe注入,它将替换第一个。
在home.jsp
.pipe(gulpif(isA, inject(ASources, transformPathA)))
.pipe(gulpif(isB, inject(BSources, transformPathB)))
我对这个gulp任务很新。如果有人可以提供帮助,那就太棒了。谢谢。
如何同时管道注入两个文件?这两个文件应该出现在我的home.jsp中的那些
之间<!-- inject:js -->
<!-- endinject --> if i add this, only the last file is getting placed here.
我该怎么做?