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
Adding @pixi/constants as a dependency. When I tried it, the whole dependency was imported (not only FORMATS). Pixi will need to add pure annotations to avoid that. In the meantime it would needlessly increase the size of this lib (perhaps terser could help though?).
Adding @pixi/constants as an optional peer dependencies. It works well, however it breaks if the user is not using a bundler, as in the example.
Inlining the enum from Pixi. It's barbaric but it works!
The text was updated successfully, but these errors were encountered:
Doing this will prevent parts of Pixi from being tree-shaked when using a module bundler. It's a shame since not much from Pixi is needed, only this small enum https://github.com/pixijs/pixi.js/blob/e4d574395aeac5ba0a89b52a47528126bcba529f/packages/constants/src/index.ts#L173-L182
Some solutions:
@pixi/constants
as a dependency. When I tried it, the whole dependency was imported (not onlyFORMATS
). Pixi will need to add pure annotations to avoid that. In the meantime it would needlessly increase the size of this lib (perhaps terser could help though?).@pixi/constants
as an optional peer dependencies. It works well, however it breaks if the user is not using a bundler, as in the example.The text was updated successfully, but these errors were encountered: