Last active
August 29, 2015 13:57
-
-
Save bradfrost/9856884 to your computer and use it in GitHub Desktop.
Using Grunt with Pattern Lab
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) { | |
// Configuration | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
shell: { | |
patternlab: { | |
command: "php core/builder.php -gp" | |
} | |
}, | |
watch: { | |
html: { | |
files: ['source/_patterns/**/*.mustache', 'source/_patterns/**/*.json', 'source/_data/*.json'], | |
tasks: ['shell:patternlab'], | |
options: { | |
spawn: false | |
} | |
} | |
} | |
}); | |
// Plugins | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-shell'); | |
// Tasks | |
grunt.registerTask('default', ['watch', 'shell:patternlab']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is more or less the
Gruntfile.js
configuration for using Pattern Lab with Grunt.In order to use Pattern Lab with Grunt, you need to install the Grunt Shell plugin, then set up a task for Pattern Lab to build every time a change is made to a
.mustache
or.json
file.