Skip to content

Instantly share code, notes, and snippets.

@bitpshr
Created April 30, 2013 16:53
Show Gist options
  • Save bitpshr/5490064 to your computer and use it in GitHub Desktop.
Save bitpshr/5490064 to your computer and use it in GitHub Desktop.
// register someTask, which is either an array of
// tasks or an empty array based on someCondition
grunt.registerTask('someTask', (function () {
return someCondition ? [ 'submodules' ] : [];
})());
// someTask is then used multiple times throughout
// the rest of the Gruntfile.
grunt.registerTask('default', [ 'someTask', 'watch:stylus' ]);
grunt.registerTask('test', [ 'someTask', 'intern-init', 'intern' ]);
grunt.registerTask('build', [ 'someTask', 'stylus:compile', 'clean', 'copy:dist' ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment