You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
687 B
JavaScript

const gulp = require('gulp');
const presetES2015 = require("@joepie91/gulp-preset-es2015");
const presetPegjs = require("@joepie91/gulp-preset-pegjs")
let sources = {
babel: ["src/**/*.js"],
pegjs: ["src/**/*.pegjs"]
}
gulp.task('babel', function() {
return gulp.src(sources.babel)
.pipe(presetES2015({
basePath: __dirname
}))
.pipe(gulp.dest("lib/"));
});
gulp.task('pegjs', function() {
return gulp.src(sources.pegjs)
.pipe(presetPegjs({
basePath: __dirname
}))
.pipe(gulp.dest("lib/"));
})
gulp.task('watch', function () {
gulp.watch(sources.babel, ['babel']);
gulp.watch(sources.pegjs, ['pegjs']);
});
gulp.task('default', ['pegjs', 'babel', 'watch']);