Organize your Gruntfile by feature
Adds grunt.mergeConfig(...)
, which replaces grunt.initConfig(...)
,
and enables you to
organize your Gruntfile by feature,
rather than by task.
Example:
Gruntfile.js
module { grunt; // Default options: grunt; // JavaScripts: grunt; grunt; // CSS: grunt; grunt; grunt; grunt; grunt; };
And then, easily split your Gruntfile into separate files!
Gruntfile.js:
module { grunt; grunt; grunt; grunt; grunt; grunt; grunt; };
build-css.js:
module { // CSS: grunt; grunt; };
build-js.js:
module { // JavaScripts: grunt; grunt; };
Etc...
Installation
Download and install via Node Package Manager:
npm install --save-dev grunt-config-merge
Then add this line near the top of your Gruntfile:
require('grunt-config-merge')(grunt);
And go ahead and start using grunt.mergeConfig
instead of grunt.initConfig
!