-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
60 lines (54 loc) · 1.29 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
60
/*
* Basic Gulp.js workflow
* for simple front-end projects
* author: Aaron John Schlosser
* homepage: http://www.aaronschlosser.com
* github: http://www.github.com/ajschlosser
*/
var gulp = require("gulp"),
gutil = require("gulp-util"),
watch = require("gulp-watch"),
compass = require("gulp-compass"),
jade = require("gulp-jade-php"),
plumber = require("gulp-plumber");
var paths = {
styles: {
src: "./scss/**/*.scss",
dest: "stylesheets"
},
templates: {
src: "./templates/*.jade",
dest: "./"
}
};
function handleError(err) {
console.log(err.toString());
this.emit('end');
}
gulp.task("styles", function() {
return gulp.src(paths.styles.src)
.pipe(plumber())
.pipe(compass({
config_file: "./config.rb",
css: "stylesheets",
sass: "scss",
image: "./images",
import_path: "./bower_components"
}))
.on("error", handleError)
.pipe(plumber.stop())
.pipe(gulp.dest(paths.styles.dest));
});
gulp.task("templates", function() {
gulp.src(paths.templates.src)
.pipe(plumber())
.pipe(jade({
pretty: '\t' // Set to false to minify/uglify the PHP
}))
.pipe(plumber.stop())
.pipe(gulp.dest(paths.templates.dest));
});
gulp.task("default", function() {
gulp.watch(paths.styles.src, ["styles"]);
gulp.watch(paths.templates.src, ["templates"]);
});