Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gulp tasks for building a design spec static site
var gulp = require('gulp');
var webserver = require('gulp-webserver');
var fileInclude = require('gulp-file-include');
/*
* Design spec build tasks:
*
* Compile and serve a design spec (style guide) site.
*/
gulp.task('dspec', ['dspec:watch'], function() {
return gulp.src('design_spec_build')
.pipe(webserver({
port: 3366,
livereload: true,
open: true,
}));
});
gulp.task('dspec:build', ['dspec:styles'], function() {
return gulp.src('design_spec/**/*')
.pipe(fileInclude({
path: 'file/design_spec',
prefix: '@@',
}))
.pipe(gulp.dest('design_spec_build'));
});
// copy App stylesheets to style guide site
gulp.task('dspec:styles', ['css'], function() {
return gulp.src('build/public/**/*.css')
.pipe(gulp.dest('design_spec_build'));
});
gulp.task('dspec:watch', function() {
gulp.watch(['design_spec/**/*'], ['dspec:build']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment