-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
64 lines (54 loc) · 1.43 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
// * Gulpfile
// * ---------------------
// * This file contains the gulp build-process.
// * ---------------------
'use strict';
const gulp = require('gulp');
const pug = require('gulp-pug');
const prefix = require('gulp-autoprefixer');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const sasslint = require('gulp-sass-lint')
const sassdoc = require('sassdoc');
gulp.task('sass', () => {
return gulp.src('./__test__/src/scss/test.scss')
.pipe(sass().on('error', sass.logError))
.pipe(prefix({
browsers: ['last 2 versions'],
}))
.pipe(rename('styles.css'))
.pipe(gulp.dest('./__test__/css'));
});
gulp.task('default', function () {
return gulp.src('./__test__/src/**/*.s+(a|c)ss')
.pipe(sassLint())
.pipe(sassLint.format())
.pipe(sassLint.failOnError())
});
gulp.task('pug', () => {
return gulp.src('./__test__/src/pug/*.pug')
.pipe(pug({
pretty: true,
}))
.pipe(gulp.dest('./__test__/'));
});
gulp.task('sassdoc', () => {
return gulp.src('./scss/**/*.scss')
.pipe(sassdoc({
display: {
alias: true
}
}));
});
gulp.task('default', ['watch']);
gulp.task('watch', ['sass', 'pug'], () => {
gulp.watch([
'./scss/*.scss', './scss/**/*.scss',
'./__test__/src/scss/test.scss',
'./__test__/src/scss/**/*.scss',
], ['sass']);
gulp.watch([
'./__test__/src/pug/*.pug',
'./__test__/src/pug/*/**.pug',
], ['pug']);
});