-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add "pure"-annotations to the source to aid code minification #343
Comments
There's a chance that even after marking things as pure, tree shaking still won't be very beneficial, due to the way |
We would love to use Fluture at Unsplash but unfortunately we're blocked by this. Is there anything we can do to help you move this forward? |
I think the most straight-forward approach is to reimplement debug mode using an environment variable, checking This will have the added benefit that multiple compatible versions of Fluture that have been installed side by side will all use the same source to enable or disable their debug modes, giving users who enable debug mode a more uniform experience. |
Tools like Rollup and UglifyJS can make better optimizations if they know certain pieces of code will never have side-effects. One way to let these tools know is via
/*#__PURE__*/
-annotations.The text was updated successfully, but these errors were encountered: