Skip to content

Commit 5b3379f

Browse files
authored
Adds ability to watch the build (#614)
1 parent 358a335 commit 5b3379f

File tree

3 files changed

+436
-0
lines changed

3 files changed

+436
-0
lines changed

gulpfile.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var rename = require('gulp-rename');
88
var replace = require('gulp-replace');
99
var source = require('vinyl-source-stream');
1010
var uglify = require('gulp-uglify');
11+
var watch = require('gulp-watch');
1112

1213
var BUILD = process.env.PARSE_BUILD || 'browser';
1314
var VERSION = require('./package.json').version;
@@ -86,3 +87,16 @@ gulp.task('minify', function() {
8687
.pipe(rename({ extname: '.min.js' }))
8788
.pipe(gulp.dest('./dist'))
8889
});
90+
91+
gulp.task('watch', function() {
92+
return watch('src/*.js', { ignoreInitial: false, verbose: true })
93+
.pipe(babel({
94+
presets: PRESETS[BUILD],
95+
plugins: PLUGINS[BUILD],
96+
}))
97+
// Second pass to kill BUILD-switched code
98+
.pipe(babel({
99+
plugins: ['minify-dead-code-elimination'],
100+
}))
101+
.pipe(gulp.dest(path.join('lib', BUILD)));
102+
});

0 commit comments

Comments
 (0)