forked from googlearchive/firefeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
53 lines (44 loc) · 1.03 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
50
51
52
53
var gulp = require('gulp'),
connect = require('gulp-connect'),
open = require('gulp-open'),
port = process.env.port || 3001;
gulp.task('open', function(){
var options = {
url: 'http://localhost:' + port,
};
gulp.src('./www/index.html')
.pipe(open('', options));
});
gulp.task('connect', function() {
connect.server({
root: 'www',
port: port,
livereload: true
});
});
gulp.task('test', function() {
connect.server({
root: '.',
port: port - 1,
livereload: true
});
var options = {
url: 'http://localhost:' + (port - 1),
};
gulp.src('./test/index.html')
.pipe(open('', options))
});
gulp.task('js', function () {
gulp.src('./www/**/*.js')
.pipe(connect.reload());
});
gulp.task('html', function () {
gulp.src('./www/*.html')
.pipe(connect.reload());
});
gulp.task('watch', function() {
gulp.watch('www/dist/js/*.js', ['js']);
gulp.watch('www/index.html', ['html']);
});
gulp.task('default', ['connect', 'watch']);
gulp.task('serve', ['connect', 'watch', 'open']);