Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using Grunt with Pattern Lab
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']);
};
@bradfrost

This comment has been minimized.

Copy link
Owner Author

commented Mar 29, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.