Troubleshooting tree-shaking
I have spent the last couple of months working on making a UI library (specifically a collection of React components for reuse in other projects) tree-shakeable. In that time, I felt like I read almost every article on tree-shaking that exists on the internet and yet some important tips were missing, leading to me not being able to find a solution to my problem. To address this gap, I thought I'd write my own post, walking you through what I found.
If you don't know what tree-shaking is, there are some wonderful articles out there - try these on for size:
