-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
49 lines (39 loc) · 1.21 KB
/
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
43
44
45
46
47
48
49
var
gulp = require('gulp'),
gutil = require('gulp-util'),
browserify = require('gulp-browserify'),
rename = require('gulp-rename'),
connect = require('gulp-connect'),
gbump = require('gulp-bump');
gulp.task('watch', function () {
gulp.watch('./lib/**/*', ['build:browser']);
});
var bump = function (type) {
gulp.src(['./bower.json', './package.json'])
.pipe(gbump({type: type}))
.pipe(gulp.dest('./'));
};
gulp.task('bump:major', function () { bump('major'); });
gulp.task('bump:minor', function () { bump('minor'); });
gulp.task('bump:patch', function () { bump('patch'); });
gulp.task('build:browser', function () {
gulp.src('./lib/index.js')
.pipe(browserify({
standalone: 'ReactFrozenHead',
transform: ['browserify-shim']
}))
.pipe(rename('react-frozenhead.js'))
.pipe(gulp.dest('./standalone/'));
});
// A server for the test page
gulp.task('testserver', connect.server({
root: [__dirname],
port: 1337,
livereload: false,
open: {
file: 'test/index.html',
browser: 'Google Chrome'
}
}));
gulp.task('test', ['build:browser', 'testserver']);
gulp.task('build', ['build:browser']);