HarveyD / react-component-library

A project skeleton to get your very own React Component Library up and running using Rollup, Typescript, SASS + Storybook
https://blog.harveydelaney.com/creating-your-own-react-component-library/
MIT License
790 stars 167 forks source link

[QUESTION] Three shaking in Next.js #48

Open bchurlinov opened 2 years ago

bchurlinov commented 2 years ago

Hey Harvey,

Thanks a lot for your hard work, saved me tons of time, much appreciated :)

I have an issue with Next.js ( 12.x ), the build size of each page. Basically, the three shaking doesn't work at all and each page imports all the components. I tried using the "code-splitting" branch but the size is even bigger.

I researched a lot RE this issue however I can't find a suitable solution. Everything points out to the library itself and not Next.js.

Do you have any suggestions and tips on how to resolve this issue ?