forked from facebookarchive/flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
33 lines (27 loc) · 824 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 gReact = require('gulp-react');
var gReplace = require('gulp-replace');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var del = require('del');
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', function() {
return browserify(browserifyConfig)
.bundle()
.pipe(source('Flux.js'))
.pipe(gulp.dest('./dist/'))
});
gulp.task('publish', ['clean', 'default']);
gulp.task('default', ['lib', 'browserify']);