Skip to content

Commit

Permalink
Move babel config into .babelrc.
Browse files Browse the repository at this point in the history
  • Loading branch information
eventualbuddha committed Jan 12, 2016
1 parent f43012c commit bdd52c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ var gulp = require('gulp'),
browserify = require('browserify'),
lazypipe = require('lazypipe'),
eslint = require('gulp-eslint'),
coffee = require('coffee-script/register');
coffee = require('coffee-script/register'),
fs = require('fs');

var TEST = [ 'test/*.coffee' ];
var SOURCE = [ 'src/**/*.js' ];
Expand Down Expand Up @@ -66,9 +67,11 @@ var ESLINT_OPTION = {
}
};

var BABEL_OPTIONS = JSON.parse(fs.readFileSync('.babelrc', { encoding: 'utf8' }));

var build = lazypipe()
.pipe(sourcemaps.init)
.pipe(babel, { presets: ['es2015'] })
.pipe(babel, BABEL_OPTIONS)
.pipe(sourcemaps.write)
.pipe(gulp.dest, 'lib');

Expand Down

0 comments on commit bdd52c7

Please sign in to comment.