Skip to content

Commit

Permalink
[BUGFIX] - Issue #46 - server side babel resiliency
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelBenin committed Jul 14, 2017
1 parent c96c168 commit 5d084dd
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions gulpfile.babel.js/tasks/gulp_babel_server.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
import gulp from 'gulp';
import { log } from 'gulp-util';
import changed from 'gulp-changed';
import babel from 'gulp-babel';
import config from './../configs/config';

gulp.task('babel-server', function babelServer() {
const babelStream = babel({
sourceMaps: 'inline',
presets: [
'react',
[
'env',
{
targets: {
node: 'current'
}
}
]
]
});

babelStream.on('error', function handleError(err) {
log(`Error transpiling babel in gulp_babel_server task.`);
log(err);
babelStream.end();
});

return gulp
.src(config.server.src)
.pipe(changed(config.dest))
.pipe(
babel({
sourceMaps: 'inline',
presets: [
'react',
[
'env',
{
targets: {
node: 'current'
}
}
]
]
})
)
.pipe(babelStream)
.pipe(gulp.dest(config.dest));
});

0 comments on commit 5d084dd

Please sign in to comment.