To reproduce:
- Run
npm run build
- Run
npm run analyze
- Look at HTML file that opens (keep this open for step 7)
- Uncomment the 2 lines that are commented out in
App.tsx
- Run
npm run build
- Run
npm run analyze
- Look at HTML file that opens (and compare with the file from step 3)
As shown by the two generated HTML files, the 2nd version that imports Xarrow
results in 69.95KB
of JS added to the production bundle via lodash/lodash.js
. So this proves that https://bundlephobia.com/package/[email protected] is correct, that all (or at least a large and unnecessary amount) of lodash
is required to be bundled with react-xarrows
(as the current way that lodash
is used in react-xarrows
doesn't allow the dead code to be tree shaken).