2015-02-22 10:27:46 -06:00
|
|
|
var gulp = require('gulp');
|
|
|
|
|
2015-05-21 20:22:20 +00:00
|
|
|
var plumber = require('gulp-plumber');
|
2015-05-14 22:08:49 +02:00
|
|
|
var babel = require('gulp-babel');
|
2015-02-22 10:27:46 -06:00
|
|
|
var options = {
|
2015-05-21 20:22:20 +00:00
|
|
|
stage: 0, // Dat ES7 goodness
|
|
|
|
optional: ["runtime"]
|
2015-02-22 10:27:46 -06:00
|
|
|
};
|
|
|
|
|
2015-02-22 10:49:29 -06:00
|
|
|
var sourcemaps = require('gulp-sourcemaps');
|
|
|
|
|
2015-02-22 10:27:46 -06:00
|
|
|
gulp.task('compile', function() {
|
2015-08-06 18:09:36 +00:00
|
|
|
return gulp
|
2015-05-14 22:08:49 +02:00
|
|
|
.src('src/**/*.js')
|
2015-05-21 20:22:20 +00:00
|
|
|
.pipe(plumber({
|
|
|
|
errorHandler: function(err) {
|
|
|
|
console.error(err.stack);
|
|
|
|
this.emit('end');
|
|
|
|
}
|
|
|
|
}))
|
2015-05-14 22:08:49 +02:00
|
|
|
.pipe(sourcemaps.init())
|
|
|
|
.pipe(babel(options))
|
2015-05-21 20:22:20 +00:00
|
|
|
.pipe(plumber.stop())
|
2015-05-14 22:08:49 +02:00
|
|
|
.pipe(sourcemaps.write('maps/'))
|
|
|
|
.pipe(gulp.dest('dist/'));
|
2015-02-22 10:27:46 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('watch', function() {
|
2015-08-06 18:09:36 +00:00
|
|
|
return gulp.watch('src/**/*.js', ['compile']);
|
2015-02-22 10:27:46 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('default', ['compile']);
|