grunt-merge-json-xduplicate
Grunt Task for Merging Multiple JSON Files without conflict of duplication (small upgrade from grunt-merge-json)
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-json-xduplicate --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
: (default\t
) the space argument forJSON.stringify()
(third argument).
Merge JSON Task
Run this task with the grunt merge-json
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/foo/foo-en.json
:
src/bar/bar-en.json
:
Assuming we want to generate the following destination JSON file:
Single file per target variant
grunt;
Multiple files per target variant
grunt;