Skip to content

Commit a3f394b

Browse files
author
Zeno Rocha
committed
DRY - Add matchdep module to make it easier to load all Grunt local modules
1 parent 31714d0 commit a3f394b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Gruntfile.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,8 @@ module.exports = function(grunt) {
6161

6262
});
6363

64-
grunt.loadNpmTasks('grunt-contrib-concat');
65-
grunt.loadNpmTasks('grunt-contrib-jasmine');
66-
grunt.loadNpmTasks('grunt-contrib-jshint');
67-
grunt.loadNpmTasks('grunt-contrib-uglify');
68-
grunt.loadNpmTasks('grunt-contrib-watch');
64+
// Load all Grunt tasks installed from NPM
65+
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
6966

7067
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
7168
grunt.registerTask('test', ['jshint', 'jasmine']);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"grunt-contrib-jshint": "~0.4.3",
1313
"grunt-contrib-concat": "~0.3.0",
1414
"grunt-contrib-uglify": "~0.2.0",
15-
"grunt-contrib-watch": "~0.4.2"
15+
"grunt-contrib-watch": "~0.4.2",
16+
"matchdep": "~0.3.0"
1617
},
1718
"scripts": {
1819
"test": "grunt test --verbose"

0 commit comments

Comments
 (0)