Run sub-projects' grunt tasks. Stolen and liberally modified from this gist by @cowboy.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install sub --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('sub');
In a separate, "master" Gruntfile, add a section named sub
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
sub: {
subdir: {
// directory containing the sub-project's Gruntfile
},
},
})
Type: String
Default value: none
A string value that grunt-sub uses to find the Gruntfile of a sub-project
This plugin is meant to augment grunt when used from the command line. Once your sub
task is configured and you've installed your sub-projects' dependencies, you may control any one of them from one location:
grunt sub:subproject:task_name
In this example, the default task is run by passing sub
just one argument: the project name.
grunt sub:subproject
In this example, an arbitrary task is run by passing sub
two arguments: the project name and the task name.
grunt sub:subproject:task
In this example, the target of a multitask is run by passing sub
three arguments: the project name, the task name, and the target name.
grunt sub:subproject:task:target
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
May 12, 2014 - Alpha release
Copyright (c) 2014 Tim Hemphill. Licensed under the MIT license.