gulpfile.js
928 Bytes
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
/**
* GULP ENTRY
* author: xuqi(qi.xu@yoho.cn)
* date: 2015/6/29
*/
var gulp = require('gulp'),
compass = require('gulp-compass'),
server = require('gulp-develop-server');
gulp.task('default', ['server', 'server:restart', 'compass-watch', 'compass']);
// start express server
gulp.task('server', function() {
server.listen({
path: 'app.js'
});
});
// restart server if app.js changed
gulp.task('server:restart', function() {
gulp.watch(['app.js', 'views/controller/*.js', 'public/js/data.js'], server.restart);
});
// compass watch
gulp.task('compass-watch', function() {
gulp.watch('public/sass/**/*.scss', ['compass']);
});
//compass
gulp.task('compass', function() {
gulp.src('public/sass/**/*.scss')
.pipe(
compass({
config_file: 'config.rb',
css: 'public/css',
sass: 'public/sass'
})
)
});