gulp-strip-code
gulp-strip-code copied to clipboard
Allow providing an array of several values for start_comment and end_comment
trafficstars
It'd be nice to be able to do something like this:
var stripCode = require('gulp-strip-code');
gulp.task('templates', function(){
gulp.src(['file.txt'])
.pipe(stripCode({
start_comment: ["<!--start-test-block-->", "/*start-test-block*/", "//start-test-block"],
end_comment: ["<!--end-test-block-->", "/*end-test-block*/", "//end-test-block"]
}))
.pipe(gulp.dest('build/file.txt'));
});
In order to parse multiple types of files in one go.
Alternatively, providing a regular expression for these values could work too. Along the lines of:
var stripCode = require('gulp-strip-code');
gulp.task('templates', function(){
gulp.src(['file.txt'])
.pipe(stripCode({
start_comment: "/(?:<!--|\/\*|\/\/)start-test-block(?:-->|\*\/)?/g",
end_comment: "/(?:<!--|\/\*|\/\/)end-test-block(?:-->|\*\/)?/g"
}))
.pipe(gulp.dest('build/file.txt'));
});