-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
31 lines (28 loc) · 865 Bytes
/
gulpfile.babel.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
import gulp from 'gulp';
import gutil from 'gulp-util';
import browserify from 'browserify';
import babelify from 'babelify';
import source from 'vinyl-source-stream';
gulp.task('build', () => {
return browserify({
entries: './source/app.jsx',
extensions: ['.jsx'],
debug: true
})
.transform('babelify', {
presets: ['es2015', 'react'],
plugins: ['transform-class-properties']
})
.bundle()
.on('error', function(err){
gutil.log(gutil.colors.red.bold('[browserify error]'));
gutil.log(err.message);
this.emit('end');
})
.pipe(source('bundle.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['build'], () => {
gulp.watch('./source/**/*.jsx', ['build']);
});
gulp.task('default', ['watch']);