-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (38 loc) · 1.13 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
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
jade = require('gulp-jade'),
stylus = require('gulp-stylus'),
imagemin = require('gulp-imagemin'),
pngquant = require('imagemin-pngquant'),
nib = require('nib');
gulp.task('build:jade', function() {
gulp.src('./src/jade/*.jade')
.pipe(plumber())
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('build:stylus', function() {
gulp.src('./src/stylus/*.styl')
.pipe(plumber())
.pipe(stylus({
use: nib(),
'include css': true
}))
.pipe(gulp.dest('./dist/css'));
});
gulp.task('imgmin', function() {
return gulp.src('src/img/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngquant()]
}))
.pipe(gulp.dest('dist/img'));
});
gulp.task('watch', function() {
gulp.watch('./src/jade/**/**/*.jade', ['build:jade']);
gulp.watch(['./src/stylus/*.styl', './src/stylus/includes/*.styl'], ['build:stylus']);
});
gulp.task('default', ['build:jade', 'build:stylus', 'watch']);