django-webpack / webpack-bundle-tracker

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

Fix issue with missing chunks when handling multiple configuration. #98

Closed TomekStaszkiewicz closed 3 years ago

TomekStaszkiewicz commented 3 years ago

See #96

I checked what changed from version 0.4.3 and I noticed that back then the small library deep-extend was used to extend resulting contents. In version 1.0.0 it was replaced by small util assign, but I believe that someone made a small mistake, and actually the util assignin was meant to be used. After changing to that it seems to be working.

TomekStaszkiewicz commented 3 years ago

I was wrong with using the assignin - it is not working as the deep-merge mechanism. It is performing only a shallow merge. I think that using lodash.merge is the best solution for this one

andersk commented 3 years ago

This has caused unexpected duplication after webpack-dev-server hot updates, due to the following behavior of lodash.merge:

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

Opened #101 to fix this.