-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
59 lines (50 loc) · 1.32 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
54
55
56
57
58
59
var gulp = require('gulp');
var coffee = require('gulp-coffee')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var plumber = require('gulp-plumber')
gulp.task('coffee-compile', function () {
return gulp.src('js/coffee/*.coffee')
.pipe(plumber())
.pipe(coffee({
bare: true
}))
.pipe(gulp.dest('js'))
})
gulp.task('coffee', ['coffee-compile'], function () {
livereload.reload()
})
gulp.task('stylus', function () {
return gulp.src('styles/stylus/main.styl')
.pipe(plumber())
.pipe(stylus())
.pipe(gulp.dest('styles'))
.pipe(livereload())
})
gulp.task('refresh', ['coffee', 'stylus'], function () {
livereload.changed()
})
function reload (e) {
livereload.changed(e.path)
}
gulp.task('atomic-reload', function () {
livereload.reload()
})
gulp.task('heavy-watcher', function () {
// reload a lot
livereload.listen()
gulp.watch('js/coffee/*.coffee', ['coffee'])
gulp.watch('styles/stylus/**/*.styl', ['stylus'])
gulp.watch(['**/*.php']).on('change', function (e) {
livereload.changed(e.path)
})
})
gulp.task('lw', function () { // light watcher
// reload only on STYLE change
livereload.listen()
gulp.watch('js/coffee/*.coffee', ['coffee-compile'])
gulp.watch('styles/stylus/**/*.styl', ['stylus']) // reload
})
gulp.task('dist', function () {
console.log('not much');
})