tettusud / merge-jsons-webpack-plugin

This plugin is used to merge json files into single json file,using glob or file names
https://npmjs.com/package/merge-jsons-webpack-plugin
Apache License 2.0
36 stars 20 forks source link

Keep file names as parent object of content in merged files #31

Closed mindtraveller closed 6 years ago

mindtraveller commented 6 years ago

Hi, Do you plan to add the possibility to keep file names in result file?

The example: There are separate i18n files:

sign_in.json

{  
    "submit": "Sign in"
}
sign_up.json

{
    "submit": "Sign up" 
}

I'd like to have following structure of the resulting file:

{ 
    "sign_in": { 
        "submit": "Sign in"
    }, 
    "sign_up": { 
        "submit": "Sign up"
    }
}
tettusud commented 6 years ago

Sure let me try to add it up.

mindtraveller commented 6 years ago

Thank you!

tettusud commented 6 years ago

I have given a new release 1.0.15 ,please check, you need to pass option prefixFileName as true, in order to prefix the file names.