gulp.task('build-system', function() { return gulp.src(paths.source) .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) .pipe(changed(paths.output, {extension: '.js'})) .pipe(sourcemaps.init({loadMaps: true})) .pipe(to5(assign({}, compilerOptions, {modules: 'system'}))) .pipe(sourcemaps.write({includeContent: true})) .pipe(gulp.dest(paths.output)); });
// transpiles files in // /test/e2e/src/ from es6 to es5 // then copies them to test/e2e/dist/ gulp.task('build-e2e', ['clean-e2e'], function() { return gulp.src(paths.e2eSpecsSrc) .pipe(plumber()) .pipe(to5(assign({}, compilerOptions.commonjs()))) .pipe(gulp.dest(paths.e2eSpecsDist)); });
// transpiles changed es6 files to SystemJS format // the plumber() call prevents 'pipe breaking' caused // by errors from other gulp plugins // https://www.npmjs.com/package/gulp-plumber gulp.task('build-system', function () { return gulp.src(paths.source) .pipe(plumber()) .pipe(changed(paths.output, {extension: '.js'})) .pipe(sourcemaps.init({loadMaps: true})) .pipe(to5(assign({}, compilerOptions, {modules:'system'}))) .pipe(sourcemaps.write({includeContent: true})) .pipe(gulp.dest(paths.output)); });
// transpiles files in // /test/e2e/src/ from es6 to es5 // then copies them to test/e2e/dist/ gulp.task('build-e2e', function () { return gulp.src(paths.e2eSpecsSrc) .pipe(plumber()) .pipe(to5()) .pipe(gulp.dest(paths.e2eSpecsDist)); });
// transpiles changed es6 files to SystemJS format // the plumber() call prevents 'pipe breaking' caused // by errors from other gulp plugins // https://www.npmjs.com/package/gulp-plumber gulp.task('build-system', function() { return gulp.src(paths.source) .pipe(plumber({errorHandler: notify.onError('Error: <%= error.message %>')})) .pipe(changed(paths.output, {extension: '.js'})) .pipe(sourcemaps.init({loadMaps: true})) .pipe(to5(assign({}, compilerOptions.system()))) .pipe(sourcemaps.write({includeContent: false, sourceRoot: '/src'})) .pipe(gulp.dest(paths.output)); });
/* Task to compile server js code with babel */ gulp.task('build-server', function () { var compilerOptions = { modules: 'common', moduleIds: false, comments: false, compact: false, stage:2, optional: ["es7.decorators", "es7.classProperties"] }; return gulp.src(paths.serverSource) .pipe(plumber()) .pipe(changed(paths.output, {extension: '.js'})) .pipe(sourcemaps.init()) .pipe(to5(assign({}, compilerOptions, {modules:'common'}))) .pipe(sourcemaps.write({includeContent: false})) .pipe(gulp.dest(paths.output)); });
// transpiles files in // /test/e2e/src/ from es6 to es5 // then copies them to test/e2e/dist/ gulp.task('build-e2e', ['clean-e2e'], function() { return gulp.src(paths.e2eSpecsSrc) .pipe(plumber()) .pipe(to5()) .pipe(gulp.dest(paths.e2eSpecsDist)); });