django-webpack / webpack-bundle-tracker

Spits out some stats about webpack compilation process to a file
MIT License
268 stars 107 forks source link

Fix corruption after hot updates due to misuse of lodash.merge #101

Closed andersk closed 3 years ago

andersk commented 3 years ago

lodash.merge has the following undesired behavior on arrays:

> chunks = { main: ['a', 'b', 'c', 'd', 'e'] }
{ main: [ 'a', 'b', 'c', 'd', 'e' ] }
> merge(chunks, { main: ['foo', 'bar'] })
{ main: [ 'foo', 'bar', 'c', 'd', 'e' ] }

Instead of using lodash.merge (#98), specify exactly which objects need to be combined using lodash.assign.

Cc @TomekStaszkiewicz @joaopslins

fjsj commented 3 years ago

Thanks @andersk . Any easy regression test we can add here to prevent such wrong behavior again?

andersk commented 3 years ago

Added tests and fixed the TypeScript typings.

(Why aren’t the CircleCI tests running on pull requests?)

fjsj commented 3 years ago

Released at 1.2.0