This repository was setup to reproduce a tree-shaking issue with react-popper-tooltip
. See: mohsinulhaq/react-popper-tooltip#97
- Hit
yarn
to bootstrap the workspace. - Change directory to
ui-components
and hityarn build:rollup
. - Change directory to
my-app
, hityarn build
and thenyarn build:analyze
. - In the analyzer window, select
build/static/js/main.*.chunk.js
file and you should see just the Button component code. - Go to
ui-components/src/index.ts
and uncommentPopperTooltip
. Repeat steps 1-4, you should now seereact-popper-tooltip
code despite being unused by the application. You can also runyarn check-treeshake
underui-components
to check whether tree-shaking was successful. However, withreact-popper-tooltip
it seems to fail fatally, so no real output. I suggest inspecting the output ofui-components/dist/esm/index.js
.