You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin adds an $import export to every module it processes. That can break code which relies on being able to re-export everything from a collection of modules using export * from <module> multiple times. For example:
If module-a and module-b are both processed by this plugin, Babel will complain of a duplicate $imports identifier here.
A workaround might be to generate a unique name for the $imports symbol in each file, and then provide a helper function to access it. Alternatively some kind of convention like taking the basename of the file could be used.
I found this while testing the plugin with Gutenberg.
The text was updated successfully, but these errors were encountered:
Rewrite export * from "module" as export { <specifiers> } from "module" where < specifiers > are automatically determined the exports of "module"
Define an alternative, non-export way of exposing a modules $imports object. For example by adding a function call at the end of the file which registers it in some global map that a test can then query.
I think I prefer (2) here because it doesn't require accessing any other files. We would need to find some key to use for the $imports object though, ideally the same as the one that would be used for import or require calls.
This plugin adds an
$import
export to every module it processes. That can break code which relies on being able to re-export everything from a collection of modules usingexport * from <module>
multiple times. For example:If
module-a
andmodule-b
are both processed by this plugin, Babel will complain of a duplicate$imports
identifier here.A workaround might be to generate a unique name for the
$imports
symbol in each file, and then provide a helper function to access it. Alternatively some kind of convention like taking the basename of the file could be used.I found this while testing the plugin with Gutenberg.
The text was updated successfully, but these errors were encountered: