-
Notifications
You must be signed in to change notification settings - Fork 119
/
gulpfile.js
executable file
·42 lines (35 loc) · 955 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'),
browserify = require('gulp-browserify'),
webserver = require('gulp-webserver');
var src = './process',
app = './builds/app';
gulp.task('js', function() {
return gulp.src( src + '/js/app.js' )
.pipe(browserify({
transform: 'reactify',
debug: true
}))
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(gulp.dest(app + '/js'));
});
gulp.task('html', function() {
gulp.src( app + '/**/*.html');
});
gulp.task('css', function() {
gulp.src( app + '/css/*.css');
});
gulp.task('watch', function() {
gulp.watch( src + '/js/**/*', ['js']);
gulp.watch( app + '/css/**/*.css', ['css']);
gulp.watch([ app + '/**/*.html'], ['html']);
});
gulp.task('webserver', function() {
gulp.src( app + '/')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('default', ['watch', 'html', 'js', 'css', 'webserver']);