forked from facebookarchive/flux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
42 lines (34 loc) · 1018 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
40
41
42
var gulp = require('gulp');
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 babel = require('gulp-babel');
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(gReplace(/__DEV__/g, 'false'))
.pipe(babel({
loose: true,
blacklist: ['spec.functionName']
}))
.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']);