Short answer: The names of plugins / custom tasks should not correlate with the specific name of the configuration object.
The grunt.js api allows access to the configuration object using the grunt.config method. Tasks and plugins have access to the entire object, and not just to the object corresponding to the name.
For example, I could create a task called foo that accesses the configuration from bar :
grunt.initConfig({ bar: { baz: true } }); grunt.registerTask('foo', 'example custom task', function () { var config = grunt.config('bar'); grunt.log.ok(config); });
Best Practice: Plugin developers should name a key for their configuration object, similar to the plugin name itself. This helps mitigate conflicts with other plugins that may link to similar ones.
grunt.initConfig({ foo: { baz: true } }); grunt.registerTask('foo', 'example custom task', function () { var config = grunt.config('foo'); grunt.log.ok(config); });
theaccordance
source share