-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
41 lines (34 loc) · 1001 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
//npm install --save-dev gulp-connect
//npm install --save-dev connect-history-api-fallback
var gulp = require('gulp'),
connect = require('gulp-connect'),
historyApiFallback = require('connect-history-api-fallback');
gulp.task('server', function() {
connect.server({
root: './public/mobile',
hostname: '0.0.0.0',
port: 8000,
livereload: true,
middleware: function(connect, opt) {
return [ historyApiFallback ];
}
});
});
gulp.task('html', function() {
gulp.src('./public/desktop/*.html')
.pipe(connect.reload());
});
gulp.task('css', function() {
gulp.src('./public/**/*.css')
.pipe(connect.reload());
});
gulp.task('js', function() {
gulp.src('./public/**/*.js')
.pipe(connect.reload());
});
gulp.task('watch', function() {
gulp.watch(['./public/**/*.html'], ['html']);
gulp.watch(['./public/**/*.css'], ['css']);
gulp.watch(['./public/**/*.js'], ['js']);
});
gulp.task('default', ['server', 'watch']);