-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (49 loc) · 1.18 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
var gulp = require('gulp');
// Plugins
var compass = require('gulp-compass'),
coffee = require('gulp-coffee');
// Paths
var basePath = './public/assets/';
var paths = {
sass: basePath + 'sass/',
css: basePath + 'css/',
coffee: basePath + 'coffee/',
js: basePath + 'js/',
images: basePath + 'images/',
};
/**
* Compile SASS down to CSS using compass
*/
function compileCSS() {
var stream = gulp.src(paths.sass + '**/*.sass')
.pipe(compass({
css: 'public/assets/css',
sass: 'public/assets/sass',
}))
.pipe(gulp.dest('public/assets/css'));
return stream;
}
/**
* Compile Coffee down to JS
*/
function compileJS() {
var stream = gulp.src(paths.coffee + '**/*.coffee')
.pipe(coffee({bare: true})
.on('error', console.log))
.pipe(gulp.dest(paths.js));
return stream;
}
function watch() {
gulp.watch(paths.sass + '**', ['css']);
gulp.watch(paths.coffee + '**', ['js']);
}
// CSS -> Sass
gulp.task('css', compileCSS);
gulp.task('compass', compileCSS);
// Coffee -> JS
gulp.task('coffee', compileJS);
gulp.task('js', compileJS);
// Watch
gulp.task('watch', watch);
// Default: this runs when you type gulp
gulp.task('default', ['css', 'js', 'watch']);