merge-jsons-webpack-plugin icon indicating copy to clipboard operation
merge-jsons-webpack-plugin copied to clipboard

Array deepMerge function

Open TheLozyBozy opened this issue 4 years ago • 3 comments

Hi, I noticed that you use the concat array method in the mergeDeep function to concat both arrays together as a one array Example: 1.json { "numbers": [1,2,3] } 2.json { "numbers": [4,5,6] } The result: { "numbers": [1,2,3,4,5,6] }

I think this is the default behavior but I would like to suggest if you can add an option to control if we want to concat the arrays or override the values like this:

1.json { "numbers": [1,2,3] } 2.json { "numbers": [4,5,6] } The result: { "numbers": [4,5,6] }

Thank you for this amazing plugin.

TheLozyBozy avatar Oct 26 '20 16:10 TheLozyBozy

New version 2.0.0-alpha is published, it will by default behave the way its requested here.

aarthishuba avatar Dec 29 '20 15:12 aarthishuba

Hi @aarthishuba where is this version ?

jimmykane avatar Feb 02 '24 09:02 jimmykane

Ok using this version I see but there is no deep merge happening

{
  "host_permissions": [
    "http://localhost:8080/*",
    "http://localhost:8000/*",
    "http://localhost:8005/*"
  ],
  "externally_connectable": {
    "matches": [ // Here there is no merge with the other file's contents 
      "https://localhost:8000/*",
      "http://localhost:8080/*",
      "http://localhost:8005/*" 
    ]
  }
}

jimmykane avatar Feb 02 '24 09:02 jimmykane