forked from facebookarchive/flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
39 lines (31 loc) · 942 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
34
35
36
37
38
39
var gulp = require('gulp');
var gReact = require('gulp-react');
var gReplace = require('gulp-replace');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var del = require('del');
var runSequence = require('run-sequence');
var browserifyConfig = {
entries: ['./index.js'],
standalone: 'Flux'
};
gulp.task('clean', function(cb) {
del(['lib/', 'Flux.js'], cb);
});
gulp.task('lib', function() {
return gulp.src('src/*.js')
.pipe(gReact({harmony: true}))
.pipe(gReplace(/__DEV__/g, 'false'))
.pipe(gulp.dest('lib'));
});
gulp.task('browserify', ['lib'], function() {
return browserify(browserifyConfig)
.bundle()
.pipe(source('Flux.js'))
.pipe(gulp.dest('./dist/'))
});
gulp.task('build', ['lib', 'browserify']);
gulp.task('publish', function(cb) {
runSequence('clean', 'build', cb);
});
gulp.task('default', ['build']);