Skip to content

Instantly share code, notes, and snippets.

@clalimarmo
Created November 21, 2015 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clalimarmo/347fb3d61a7620d8cefb to your computer and use it in GitHub Desktop.
Save clalimarmo/347fb3d61a7620d8cefb to your computer and use it in GitHub Desktop.
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