-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (29 loc) · 983 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const shell = require('gulp-shell');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const syntax = require('postcss-scss');
gulp.task('sass', function() {
const processors = [
autoprefixer({browsers: ['last 2 version', '> 1%']}),
];
return gulp.src('./sass/*.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(postcss(processors, {syntax: syntax}))
.pipe(gulp.dest('./css'));
});
gulp.task('hbs', function() {
return gulp.src('./*.hbs', {read: false})
.pipe(shell(['node tools/compile.js']))
});
gulp.task('hbs:js', function() {
return gulp.src('./content/*.js')
.pipe(shell(['node tools/compile.js']))
});
gulp.task('watch', function() {
gulp.watch('./sass/*.scss', ['sass']);
gulp.watch('./index.hbs', ['hbs']);
gulp.watch('./content/*.js', ['hbs:js'])
});
gulp.task('default', ['sass', 'watch']);