I have multiple JSON files, each located in different paths. Now I'm trying to concat all files with "grunt-concat-json".
The source JSON files are looking like this:
ExampleA.json
[ {
"configPath": "Example A"
} ]
ExampleB.json
[ {
"configPath": "Example B"
} ]
How can I configure my GRUNT Task to get following result JSON File:
[
{
"configPath": "Example A"
},
{
"configPath": "Example B"
} ]
I've tried with this config:
concat: {
json:
{
src: [
'pathA/ExampleA.json',
'pathB/ExampleB.json
],
dest: 'pathX/Merged.json',
options: {
separator: ','
}
}
},
With this setting I get following result:
[
{
"configPath": "Example A"
}
],
[
{
"configPath": "Example B"
}
]
but my result JSON should only have ONE array, which I can loop through in my code like
configPaths.forEach(configPath) { ... }