Does the React compiler do tree shaking ? #49
Answered
by
poteto
KingAmo
asked this question in
General Questions
-
Does React compiler do tree shaking or it will be able to do tree shaking in the future? |
Beta Was this translation helpful? Give feedback.
Answered by
poteto
Jan 2, 2025
Replies: 1 comment 2 replies
-
Afaik it doesn't do that and doesn't plan to The React Compiler only operates on files in isolation, it doesn't see or modify your app's module graph. It's currently exposed as a Babel plugin, and Babel plugins do not have this ability. Tree shaking is a bundler feature, and React Compiler is not a bundler. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are no current plans to add tree shaking to the compiler.