Created
May 8, 2015 12:26
-
-
Save matt-bailey/65ecc6d498348d5ff5e9 to your computer and use it in GitHub Desktop.
SC5 Style Guide Generator Grunt usage instructions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
var gulp = require('gulp'), | |
styleguide = require('sc5-styleguide'); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
dist: { | |
files: { | |
'main.css': 'main.scss' | |
} | |
} | |
}, | |
gulp: { | |
'styleguide-generate': function() { | |
var outputPath = 'output'; | |
return gulp.src(['main.scss']) | |
.pipe(styleguide.generate({ | |
title: 'My Styleguide', | |
server: true, | |
rootPath: outputPath | |
})) | |
.pipe(gulp.dest(outputPath)); | |
}, | |
'styleguide-applystyles': function() { | |
gulp.src('main.scss') | |
.pipe(styleguide.applyStyles()) | |
.pipe(gulp.dest('output')); | |
} | |
}, | |
watch: { | |
scss: { | |
files: '**/*.scss', | |
tasks: ['sass', 'gulp:styleguide-generate', 'gulp:styleguide-applystyles'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-sass'); | |
grunt.loadNpmTasks('grunt-gulp'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.registerTask('default', ['gulp:styleguide-generate', 'gulp:styleguide-applystyles', 'watch']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. This was very helpful. Wasn't sure what was failing with the standard documentation, but your guide got me in the right direction.