Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create dev / prod versions using compile-time constants and tree-shaking #18

Open
AndrewPrifer opened this issue Jul 12, 2024 · 0 comments

Comments

@AndrewPrifer
Copy link
Owner

AndrewPrifer commented Jul 12, 2024

Currently we simply have two different entry points, 1 for dev, 1 for prod. Use the define config property and tree-shaking instead. Have a conditional config we can run twice for each target. This will scale better to when we want to alter things deeper in the import hierarchy anyway, like stripping UI code from createThreeGizmo().

https://tsup.egoist.dev/#conditional-config
https://tsup.egoist.dev/#compile-time-environment-variables
https://tsup.egoist.dev/#custom-esbuild-plugin-and-options

If treeshaking is not working, try the treeshake option which runs Rollup on the output:
https://tsup.egoist.dev/#tree-shaking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant