Skip to content

Is EUI tree-shakeable? #5386

Closed Answered by chandlerprall
lightwave asked this question in Q&A
Discussion options

You must be logged in to vote

Confirmed again via create-react-app, started with new project & added EUI+dependencies, then imported & used just the EuiButton component. Dev experience (yarn start) loads 10.7mb of resources while the production build (yarn build) only loads 241kb.

There's nothing special about tree-shaking for EUI (or shouldn't be, and that appears to be true). The webpack docs have a tree shaking guide which has always worked for me with EUI on custom, non-create-react-app projects.

For completeness, I should mentioned that the CSS bundle we provide is never pruned.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by chandlerprall

This comment has been hidden.

@chandlerprall

This comment has been hidden.

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #5377 on November 17, 2021 16:52.