-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (31 loc) · 1.28 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
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var watchify = require('watchify');
var source = require('vinyl-source-stream');
gulp.task('build-ui', function () {
return watchify(browserify({entries: './src/ui/app.jsx', extensions: ['.jsx'], debug: true}))
.transform('babelify', {presets: ['es2015', 'react']})
.bundle()
.pipe(source('app.js'))
.pipe(gulp.dest('build/ui/js'));
});
gulp.task('build-generator', function () {
return browserify({entries: './src/ui/tasks/generator.js', extensions: ['.js'], debug: true})
.transform('babelify', {presets: ['es2015']})
.bundle()
.pipe(source('generator.js'))
.pipe(gulp.dest('build/ui/js'));
});
gulp.task('build-tracer', function () {
return browserify({entries: './src/interpreter/interpreter.js', extensions: ['.js'], debug: true})
.bundle()
.pipe(source('interpreter.js'))
.pipe(gulp.dest('build/ui/js'));
});
gulp.task('watch', ['build-ui', 'build-tracer', 'build-generator'], function () {
gulp.watch('**/*.jsx', ['build-ui']);
gulp.watch('./src/interpreter/**/*.js', ['build-tracer']);
gulp.watch('./src/ui/tasks/*.js', ['build-generator']);
});
gulp.task('default', ['watch']);