-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
64 lines (50 loc) · 1.47 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
61
62
63
64
'use strict';
var gulp = require('gulp');
var path = require('path');
var sass = require('gulp-sass');
var jade = require('gulp-jade');
var compass = require('gulp-compass');
var jadesassDir = './layout',
htmlcssDir = './layout';
var source = {
sassDir: path.join(jadesassDir, 'style/sass'),
jadeDir: path.join(jadesassDir, 'templates/jade'),
imagesDir: path.join(jadesassDir, 'images'),
sassFileDir: path.join(jadesassDir, 'style/sass/*.scss'),
jadeFileDir: path.join(jadesassDir, 'templates/jade/*.jade')
}
var output = {
cssDir: path.join(htmlcssDir, 'style/css'),
htmlDir: path.join(htmlcssDir, 'templates/html')
}
gulp.task('sass', function() {
gulp.src(source.sassFileDir)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(output.cssDir));
});
gulp.task('compass', function() {
gulp.src(source.sassFileDir)
.pipe(compass({
config_file: './config.rb',
images: source.imagesDir,
sass: source.sassDir,
css: output.cssDir
}))
.pipe(gulp.dest(output.cssDir));
});
gulp.task('jade', function() {
gulp.src(source.jadeFileDir)
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest(output.htmlDir))
});
gulp.task('compass:watch', function() {
gulp.watch(source.sassFileDir, ['compass']);
});
gulp.task('jade:watch', function() {
gulp.watch(source.jadeFileDir, ['jade']);
});
gulp.task('build', ['compass', 'jade']);
gulp.task('watch', ['compass:watch', 'jade:watch']);
gulp.task('default', ['build', 'watch']);