-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
53 lines (47 loc) · 1.16 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'),
nodemon = require('gulp-nodemon'),
plumber = require('gulp-plumber'),
livereload = require('gulp-livereload'),
sass = require('gulp-sass'),
localtunnel = require('localtunnel');
gulp.task('sass', function () {
gulp.src('./public/css/*.scss')
.pipe(plumber())
.pipe(sass())
.pipe(gulp.dest('./public/css'))
.pipe(livereload());
});
gulp.task('watch', function() {
gulp.watch('./public/css/*.scss', ['sass']);
});
gulp.task('develop', function () {
livereload.listen();
nodemon({
script: 'bin/www',
ext: 'js jade coffee',
stdout: false
}).on('readable', function () {
this.stdout.on('data', function (chunk) {
if(/^Express server listening on port/.test(chunk)){
livereload.changed(__dirname);
}
});
this.stdout.pipe(process.stdout);
this.stderr.pipe(process.stderr);
});
});
gulp.task('tunnel', function() {
var tunnel = localtunnel(3012, {
subdomain: 'namtran1989'
},function(err, tunnel) {
console.log(err, tunnel);
});
tunnel.on('close', function() {
console.log('Tunnel closed');
});
})
gulp.task('default', [
'sass',
'develop',
'watch'
]);