forked from SC5/sc5-styleguide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-gulpfile.js
40 lines (35 loc) · 1.16 KB
/
demo-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
var gulp = require('gulp'),
sass = require('gulp-sass'),
neat = require('node-neat'),
styleguide = require('./lib/styleguide'),
source = 'lib/app/**/*.scss',
outputPath = 'demo-output';
gulp.task('styleguide:generate', function() {
return gulp.src(source)
.pipe(styleguide.generate({
title: 'SC5 Styleguide',
server: true,
rootPath: outputPath,
overviewPath: 'README.md',
styleVariables: 'lib/app/sass/_styleguide_variables.scss'
}))
.pipe(gulp.dest(outputPath));
});
gulp.task('styleguide:applystyles', function() {
return gulp.src('lib/app/sass/app.scss')
.pipe(sass({
errLogToConsole: true,
includePaths: neat.includePaths
}))
.pipe(styleguide.applyStyles())
.pipe(gulp.dest(outputPath));
});
gulp.task('styleguide', ['styleguide:static', 'styleguide:generate', 'styleguide:applystyles']);
gulp.task('styleguide:static', function() {
gulp.src(['lib/demo/**'])
.pipe(gulp.dest(outputPath + '/demo'));
});
gulp.task('watch', ['styleguide'], function() {
// Start watching changes and update styleguide whenever changes are detected
gulp.watch(source, ['styleguide']);
});