node-minecraft-protocol/gulpfile.js

33 lines
704 B
JavaScript
Raw Normal View History

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