add babelify test and example

This commit is contained in:
Philipp Kunz 2016-06-03 20:57:10 +02:00
parent 7e210d473f
commit 7065094a84
3 changed files with 33 additions and 2 deletions

View File

@ -16,7 +16,12 @@ gulp-browser is meant to be easy:
let gulp = require("gulp"); let gulp = require("gulp");
let gulpBrowser = require("gulp-browser"); let gulpBrowser = require("gulp-browser");
let transforms = []; let transforms = [
{
transform: "babelify",
options: {presets: ["es2015", "react"]}
}
];
gulp.task('gulpBrowserTest',function() { gulp.task('gulpBrowserTest',function() {
var stream = gulp.src('./test/*.js') var stream = gulp.src('./test/*.js')

File diff suppressed because one or more lines are too long

View File

@ -40,5 +40,18 @@ describe("gulpBrowser", function () {
.pipe(plugins.gulp.dest("./test/result/")) .pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpFunction(done)); .pipe(plugins.gulpFunction(done));
}); });
it("should run through work with transforms", function (done) {
this.timeout(30000);
let transforms = [
{
transform: "babelify",
options: {presets: ["es2015", "react"]}
}
];
let stream = plugins.gulp.src('./test/testBrowserifyNormal.js')
.pipe(plugins.gulpBrowser.browserify(transforms))
.pipe(plugins.gulp.dest("./test/result/"))
.pipe(plugins.gulpFunction(done));
});
}); });
}); });