grunt-merge-json
Grunt Task for Merging Multiple JSON Files
Getting Started
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-merge-locale --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
Task Options
replacer
: (defaultnull
) the replacer argument forJSON.stringify()
(second argument).space
: (defaulttrue
) the space argument forJSON.stringify()
(third argument).includeFilename
: (defaulttrue
) add the file name as the parent node in the json file when merging the contents of the source filedestFileName
: (defaultrb
) file name of the destination filedestFileExt
: (defaultjson
) file extension of the resulting locale file
Merge JSON Task
Run this task with the grunt merge-local
command.
Task targets, files and options may be specified according to the Grunt Configuring tasks guide.
Usage Example
Assuming we have the following types of source JSON files:
src/locale/en/foo.json
:
src/locale/en/bar.json
:
Assuming we want to generate the following destination JSON file:
dest/locale/en/rb.json
:
Grunt Config
grunt;