-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
83 lines (66 loc) · 1.69 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* --------- plugins --------- */
var
gulp = require('gulp'),
compass = require('gulp-compass'),
jade = require('gulp-jade'),
browserSync = require('browser-sync').create(),
plumber = require('gulp-plumber');
/* --------- paths --------- */
var
paths = {
jade : {
location : 'app/templates/**/*.jade',
compiled : 'app/templates/_pages/*.jade',
destination : 'app/'
},
scss : {
location : 'app/scss/**/*.scss',
entryPoint : 'app/css/main.css'
},
compass : {
configFile : 'config.rb',
cssFolder : 'app/css',
scssFolder : 'app/scss',
imgFolder : 'app/img'
},
browserSync : {
baseDir : 'app/',
watchPaths : ['*.html', 'css/*.css', 'js/*.js']
}
}
/* --------- jade --------- */
gulp.task('jade', function() {
gulp.src(paths.jade.compiled)
.pipe(plumber())
.pipe(jade({
pretty: '\t',
}))
.pipe(gulp.dest(paths.jade.destination));
});
/* --------- scss-compass --------- */
gulp.task('compass', function() {
gulp.src(paths.scss.location)
.pipe(plumber())
.pipe(compass({
config_file: paths.compass.configFile,
css: paths.compass.cssFolder,
sass: paths.compass.scssFolder,
image: paths.compass.imgFolder
}));
});
/* --------- browser sync --------- */
gulp.task('sync', function() {
browserSync.init({
server: {
baseDir: paths.browserSync.baseDir
}
});
});
/* --------- watch --------- */
gulp.task('watch', function(){
gulp.watch(paths.jade.location, ['jade']);
gulp.watch(paths.scss.location, ['compass']);
gulp.watch(paths.browserSync.watchPaths).on('change', browserSync.reload);
});
/* --------- default --------- */
gulp.task('default', ['jade', 'compass', 'sync', 'watch']);