-
Notifications
You must be signed in to change notification settings - Fork 12
/
gulpfile.js
36 lines (31 loc) · 888 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
var gulp = require("gulp");
var plumber = require("gulp-plumber");
var concat = require("gulp-concat");
var util = require("gulp-util");
var sass = require("gulp-ruby-sass");
var coffee = require("gulp-coffee");
var static = "./static/";
var cssDir = static + "css/";
var cssFile = cssDir + "app.sass";
var cssFiles = cssDir + "**/*.sass";
var jsDir = static + "js/";
var jsFile = jsDir + "app.coffee";
var jsFiles = jsDir + "**/*.coffee";
gulp.task("default", function() {
gulp.watch(cssFiles, ["compileSass"]);
gulp.watch(jsFiles, ["compileCoffee"]);
});
gulp.task("compileSass", function() {
return sass(cssFile)
.on('error', sass.logError)
.pipe(gulp.dest(cssDir));
});
gulp.task("compileCoffee", function() {
return gulp.src(jsFiles)
.pipe(plumber())
.pipe(
coffee({bare: true}).on('error', util.log)
)
.pipe(concat("build.js"))
.pipe(gulp.dest(jsDir))
});