Replies: 2 comments 8 replies
-
Adding the contexts to |
Beta Was this translation helpful? Give feedback.
1 reply
-
@JSerFeng You could use https://github.com/swc-project/swc/tree/main/crates/swc_ecma_usage_analyzer. The minifier use it to do scope analysis. It might be enough/overload for simple use cases. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scope is hard to deal with in some certain plugi transform. It is very useful if we can get scope information of current visiting node.
We dont need to use Arc or Rc, we can make a new Scope instance every time we enter a node, like what have done in visit_with_path.
We can do this by:
How do you think of that, willing to contribute.
Also if you think this is a good idea, what field should the scope contains, and what should I do if I want to both use scope and path feature, visit_scope_and_path? Or add visit with context, and the context can have the field path and scope based on the feature.
Beta Was this translation helpful? Give feedback.
All reactions