-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
39 lines (33 loc) · 1.04 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
const gulp = require('gulp')
const sass = require('gulp-sass')
const sassLint = require('gulp-sass-lint')
const commentsToMd = require('gulp-comments-to-md')
const gulpConcat = require('gulp-concat')
gulp.task('[SASS] Compile', () => {
return gulp.src('./src/usb.scss')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest('./dist'))
})
gulp.task('[SASS] Lint', () => {
return gulp.src('dist/**/*.scss')
.pipe(sassLint({
configFile: '.sass-lint.yml'
}))
.pipe(sassLint.format())
.pipe(sassLint.failOnError())
})
gulp.task('[Readme] Generate features', () => {
return gulp.src('src/**/*.scss')
.pipe(commentsToMd('features.md'))
.pipe(gulp.dest('docs/'))
})
gulp.task('[Readme] Generate README.md', ['[Readme] Generate features'], () => {
return gulp.src([
'./docs/readme.md',
'./docs/features.md'
])
.pipe(gulpConcat('README.md'))
.pipe(gulp.dest('./'))
})
gulp.task('docs', ['[Readme] Generate README.md'])
gulp.task('default', ['[SASS] Compile', '[SASS] Lint'])