-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgulpfile.js
33 lines (29 loc) · 904 Bytes
/
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
var gulp = require('gulp');
var browserify = require('browserify');
var reactify = require('reactify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
gulp.task('watch', function() {
gulp.watch('./js/**/*.js', ['app', 'example']);
gulp.watch('./example/example.jsx', ['example']);
});
gulp.task('app', function() {
return browserify('./js/app.js', {'standalone': 'ReactMultiselect'})
.transform(reactify)
.bundle()
.pipe(source('build.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./build'));
});
gulp.task('example', function() {
return browserify('./example/example.jsx')
.transform(reactify)
.bundle()
.pipe(source('example.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./example'));
});
gulp.task('default', ['app', 'example']);