webpack-bundle-delta icon indicating copy to clipboard operation
webpack-bundle-delta copied to clipboard

Feature: Duplicate dependency detection across different chunks

Open pjlee11 opened this issue 4 years ago • 0 comments

Currently webpack-bundle-delta detects duplicate dependencies when they are in the same chunk which is awesome, however it would be good to push this one step further with duplicate dependency detection across all chunks. This should be an opt-in feature behind a flag as by default not all applications would need it.

The idea behind this is that some complex applications will have chunks brought in by other chunks (EG: dynamic imports) which could end up with duplicate dependencies. Take the following example:

Example

// bundle-a.js
require.ensure('bundle-c.js');
deps: [
  'cool-dependency': ^2.6.0,
]

// bundle-b.js
require.ensure('bundle-c.js');
deps: [
  'cool-dependency': ^3.0.2,
]

// bundle-c.js
deps: [
  'cool-dependency': ^3.1.0,
]

Any page that uses bundle-a will have have [email protected] and [email protected] which we would want to know be reported on the PR.

pjlee11 avatar Nov 23 '20 10:11 pjlee11