pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.36k stars 178 forks source link

Enable tree-shaking by setting sideEffects to false #365

Closed brunobispo closed 1 year ago

brunobispo commented 1 year ago

Description:

By adding the sideEffects property to the package.json file, we enable bundlers to remove unused code. The following reports show the difference between having this change and not having it:

Before After
image image

Related issue (if exists): https://github.com/pixijs/pixi-react/issues/356

baseten commented 1 year ago

Hi @brunobispo, many thanks for your PR - just to let you know that this is on my radar, but I've been making several significant changes to the repo in the last couple of weeks and as such this won't be mergeable for now.

Once we have the structural changes merged I'll get this added too. In the mean time, if it's urgently needed for a project I suggest you make your own fork.

baseten commented 1 year ago

@brunobispo the mono repo packages have just been published to as v7.0.0-alpha.1 which also includes PIXI v7 support

@pixi/react @pixi/animated @pixi/react-legacy @pixi/animated-legacy

All have sideEffects: false, hope this helps!