forked from daynin/tiny-lisp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (37 loc) · 1.04 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const gulp = require('gulp');
const jison = require('gulp-jison');
const babel = require('gulp-babel');
const jasmine = require('gulp-jasmine');
const watch = require('gulp-watch');
gulp.task('test', () => {
return gulp.src('./tmp/spec/**/*.spec.js')
.pipe(jasmine());
});
gulp.task('watch', function() {
gulp.watch(['./src/**/*.js', './test/**/*.js', './src/**/*.jison'], ['build']);
});
gulp.task('build-src', () => {
return gulp.src('./src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('./lib'));
});
gulp.task('build-test', () => {
return gulp.src('./test/**/*.spec.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('./tmp/spec'));
});
gulp.task('jison', () => {
return gulp.src('./src/**/*.jison')
.pipe(jison({
moduleType: 'commonjs'
}))
.pipe(gulp.dest('./lib'));
});
gulp.task('build', ['jison', 'build-src', 'build-test'], () => {
gulp.start('test');
});
gulp.task('serve', ['build'], () => {
gulp.start('watch');
});