-
Notifications
You must be signed in to change notification settings - Fork 27
/
gulpfile.js
45 lines (40 loc) · 1.17 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
const gulp = require('gulp')
const concat = require('gulp-concat');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const customProperties = require('postcss-css-variables');
const Import = require('postcss-import');
const styleGuide = require('postcss-style-guide');
const extend = require('postcss-extend');
const nano = require('cssnano');
const extractVars = require('postcss-extract-vars');
function styles() {
return gulp.src('./src/styles/app.css')
.pipe(postcss([
Import,
extend,
extractVars({
file: './public/customVars.css'
}),
customProperties({ preserve: true }),
autoprefixer,
styleGuide({
project: 'Spinnaker',
dest: './public/styleguide.html',
showCode: false,
themePath: './src/styleguide-template/'
}),
nano
]))
.pipe(concat('./public/styleguide.min.css'))
.pipe(gulp.dest('.'));
}
let build = gulp.series(styles);
function watch() {
gulp.watch(['./src/styles/*.css', './src/styleguide-template/*.*'],
build);
}
exports.watch = watch;
exports.styles = styles;
gulp.task('default', watch);
gulp.task('build', build);