-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
38 lines (34 loc) · 972 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
36
37
38
var gulp = require('gulp');
var styleguide = require('sc5-styleguide');
var sass = require('gulp-sass');
var outputPath = 'output';
gulp.task('styleguide:generate', function() {
return gulp
.src('*.scss')
.pipe(
styleguide.generate({
title: 'My Styleguide',
server: true,
rootPath: outputPath,
overviewPath: 'README.md'
})
)
.pipe(gulp.dest(outputPath));
});
gulp.task('styleguide:applystyles', function() {
return gulp
.src('src/styles.scss')
.pipe(
sass({
errLogToConsole: true
})
)
.pipe(styleguide.applyStyles())
.pipe(gulp.dest(outputPath));
});
gulp.task('watch', ['styleguide'], function() {
// Start watching changes and update styleguide whenever changes are detected
// Styleguide automatically detects existing server instance
gulp.watch(['*.scss'], ['styleguide']);
});
gulp.task('styleguide', ['styleguide:generate', 'styleguide:applystyles']);