-
Notifications
You must be signed in to change notification settings - Fork 2
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
smarter function eval/inline #15
Comments
Interesting thing, terser has same strategy as for |
Currently, there is a I can also think of some other strategies:
And there is also a problem of export function f() {
effect()
}
export const x = f() being tree-shaked into export function f() {
effect();
}
export const x = (f(), undefined); This is not hard to solve but will lead to more lines of code - every transform function should return whether the value is still reserved. Not sure if there is a better strategy. |
https://kermanx.github.io/tree-shaker/#N4IglgdgDgrgLiAXCAZjCBjOYD2EAEcApgM5wAUAlPsADoH4BORcMjBtIAhj73153oBfeqMx4SOADZEAdFJwBzcsTLkAjJUr0ME6XIXLVFTdvERJM+UpWkTWnXquHba044v7rRuxofnLAxtjPzNdT2dg33cArxcQmPDA71d7MKcgnzd/JLio7LMxehAAGhAAExwAFWYiAGUACy4AayIkOEYYIjLKgFlIMBQATyQULikSIiEgA===
For this case, the optimized result is larger than the unoptimized version.
The text was updated successfully, but these errors were encountered: