-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
42 lines (35 loc) · 1009 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 browserify = require('browserify');
var source = require('vinyl-source-stream');
var browserSync = require('browser-sync')
var babelify = require("babelify");
// var reactify = require('reactify');
gulp.task('js', function() {
return browserify(
{
entries: 'app.js',
extensions: ['.jsx'],
debug: true
})
.transform(babelify)
.bundle()
.pipe(source("build.js"))
.pipe(gulp.dest("build"))
.pipe(browserSync.reload({ stream:true }));
});
gulp.task('bs-reload', function () {
browserSync.reload();
});
// gulp.task('js-watch', ['js'], browserSync.reload);
gulp.task('serve', function() {
browserSync.init({
server: {
baseDir: "./"
}
});
// gulp.watch("component/*.jsx", ['js-watch']);
});
gulp.task('default', ['serve'], function(){
gulp.watch("./component/*.jsx", ['js']);
gulp.watch("./component/*.jsx", ['bs-reload']);
});