Skip to content

Instantly share code, notes, and snippets.

@bittersweetryan
Last active December 20, 2015 08:59
Show Gist options
  • Save bittersweetryan/6104269 to your computer and use it in GitHub Desktop.
Save bittersweetryan/6104269 to your computer and use it in GitHub Desktop.
This trick will dynamically load NPM tasks instead of having to load them manually.
/*
first install matchdep via NPM: npm-install matchdep --save-dev
then replace all of your grunt.loadNpmTasks( 'taskname' ) code with the following line:
*/
//dynamically load tasks
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment