diff --git a/gulp/handlebars.js b/gulp/handlebars.js index 3109f92bf..482ba68f5 100644 --- a/gulp/handlebars.js +++ b/gulp/handlebars.js @@ -5,14 +5,14 @@ var concat = require('gulp-concat'); var wrap = require("gulp-wrap"); var path = require('path'); var streamqueue = require('streamqueue'); +var stripbom = require('gulp-stripbom'); var paths = require('./paths.js'); -var bom = require('./pipelines/gulp-bom.js'); gulp.task('handlebars', function () { var coreStream = gulp.src([paths.src.templates, '!*/**/*Partial.*']) - .pipe(bom()) + .pipe(stripbom({ showLog: false })) .pipe(handlebars()) .pipe(declare({ namespace: 'T', @@ -29,7 +29,7 @@ gulp.task('handlebars', function () { })); var partialStream = gulp.src([paths.src.partials]) - .pipe(bom()) + .pipe(stripbom({ showLog: false })) .pipe(handlebars()) .pipe(wrap('Handlebars.template(<%= contents %>)')) .pipe(wrap('Handlebars.registerPartial(<%= processPartialName(file.relative) %>, <%= contents %>)', {}, { diff --git a/gulp/pipelines/gulp-bom.js b/gulp/pipelines/gulp-bom.js deleted file mode 100644 index 5d49e601a..000000000 --- a/gulp/pipelines/gulp-bom.js +++ /dev/null @@ -1,4 +0,0 @@ -var replace = require('gulp-replace'); -module.exports = function() { - return replace(/^\uFEFF/, ''); -}; diff --git a/gulp/stripBom.js b/gulp/stripBom.js index ff6b610ca..7ee54e230 100644 --- a/gulp/stripBom.js +++ b/gulp/stripBom.js @@ -1,22 +1,14 @@ var gulp = require('gulp'); var paths = require('./paths.js'); -var bom = require('./pipelines/gulp-bom.js'); -var gulpPrint = require('gulp-print'); - +var stripbom = require('gulp-stripbom'); var stripBom = function (dest) { gulp.src([paths.src.scripts, paths.src.exclude.libs]) - .pipe(bom()) - .pipe(gulpPrint(function (filepath) { - return "booming: " + filepath; - })) + .pipe(stripbom({ showLog: false })) .pipe(gulp.dest(dest)); gulp.src(paths.src.templates) - .pipe(bom()) - .pipe(gulpPrint(function (filepath) { - return "booming: " + filepath; - })) + .pipe(stripbom({ showLog: false })) .pipe(gulp.dest(dest)); }; diff --git a/package.json b/package.json index 4da1804a2..21ab426e5 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "gulp-less": "2.0.1", "gulp-print": "1.1.0", "gulp-replace": "0.5.2", + "gulp-stripbom": "1.0.4", "gulp-run": "1.6.6", "gulp-webpack": "1.2.0", "gulp-wrap": "0.10.1",