You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have built a package with tsdx and when i analyzed the compiled package with the source mapper it's not tree-shaking the unnecessary files.
I used react-icons in one of the files and then build the package the build code size did not increase but when i used the package the react build imported all the icons from react-icon/fa. also when i build with parcel and check the build size and same happend it increased the project build by a lot.
package build
parcel build
am I missing something about ESM and CJS. i know that cjs don't tree shake so do i have to setup something for tree shake to work??
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have built a package with tsdx and when i analyzed the compiled package with the source mapper it's not tree-shaking the unnecessary files.
I used react-icons in one of the files and then build the package the build code size did not increase but when i used the package the react build imported all the icons from react-icon/fa. also when i build with parcel and check the build size and same happend it increased the project build by a lot.
package build
parcel build
am I missing something about ESM and CJS. i know that cjs don't tree shake so do i have to setup something for tree shake to work??
Beta Was this translation helpful? Give feedback.
All reactions