@@ -4,6 +4,7 @@ module.exports = function(grunt, settings, undefined)
44 var _ = require ( 'lodash' ) ,
55 path = require ( 'path' ) ,
66 loader = require ( 'load-grunt-config' ) ,
7+ gruntLoader = require ( './grunt-loader' ) ,
78 base = path . dirname ( __dirname ) ;
89
910 // Get the settings and options
@@ -26,6 +27,11 @@ module.exports = function(grunt, settings, undefined)
2627
2728 // We need to load the local grunt plugins
2829 var projectDir = process . cwd ( ) ;
30+
31+ // load both project and this plugin's grunt modules manually to account for NPM 3+ flattening
32+ gruntLoader . load ( grunt , projectDir ) ;
33+ gruntLoader . load ( grunt , pluginFolder ) ;
34+
2935 process . chdir ( pluginFolder ) ;
3036
3137 // The build file which contains all the list of files to build
@@ -70,16 +76,14 @@ module.exports = function(grunt, settings, undefined)
7076
7177 // auto grunt.initConfig()
7278 init : false ,
73-
74- // Load the grunt tasks
75- loadGruntTasks : { pattern : [
76- 'grunt-*' ,
77- '!grunt-springroll'
78- ] } ,
79+
80+ // don't load grunt tasks, since we'll load them manually (due to NPM 2 vs. NPM 3+ behavioral differences)
81+ loadGruntTasks : false ,
7982
8083 // Data based into config
8184 data : data
8285 } ) ;
86+
8387 process . chdir ( projectDir ) ;
8488
8589 // Project-specific config
@@ -91,11 +95,8 @@ module.exports = function(grunt, settings, undefined)
9195 // Get the config, don't run
9296 init : false ,
9397
94- // We don't want to reload builder
95- loadGruntTasks : { pattern : [
96- 'grunt-*' ,
97- '!grunt-springroll'
98- ] }
98+ // don't load grunt tasks, since we'll load them manually (due to NPM 2 vs. NPM 3+ behavioral differences)
99+ loadGruntTasks : false
99100 } ) ;
100101
101102 // Merge the configs
@@ -119,4 +120,4 @@ module.exports = function(grunt, settings, undefined)
119120 }
120121
121122 return config ;
122- } ;
123+ } ;
0 commit comments