Replies: 1 comment 2 replies
-
Sharing scope is better, but it may require some strange tricks or |
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
-
I'm attempting a bugfix for #1786. The README suggests that I should ask here for guidance understanding swc's codebase.
I see that
ImportAnalyzer
andCommonJs
transformers both usescope.import_types
to understand if arequire()
needs to be wrapped ininteropRequireDefault
orinteropRequireWildcard
. However, the transformers do not seem to share aScope
instance.This causes problems when
ImportAnalyzer
marks an import as wildcard, butCommonJs
does not know this and treats it as a default import.Should transformers share a single
scope
instance, or shouldimport_types
be copied from one transformer to the next?Beta Was this translation helpful? Give feedback.
All reactions