In my react application, I am using react-transition-group
node module. In the prod build, webpack (5.36.2) is clubbing this module in multiple chunks and not with the vendor even though I have defined vendor splitChunks cacheGroup config as node_modules folder.
vendor: /[\/]node_modules[\/]/,
My question is why isn’t webpack making a single chunk for this module so it can be loaded in all pages making use of it?
Also sometimes it clubs this module with components that are not needed in a particular page but get loaded through the chunk because of the node module. How should we deal with this?