Open dalimian opened 2 months ago
You may try noInterop: true
for swc
And please provide a minimal reproduction
thanks @kdy1 , here is github and codesandbox links that minimally reproduce the issue, whichever you prefer
I did try noInterop: true
, it did fix this issue but introduced another issue where nothing from node_modules could be imported, links above reproduce that as well
Describe the feature
after migrating jest from babel to swc we found that now our unit tests have to specify an
__esModule: true
when mocking a module that has a default export.example:
worth a mention that it seems this is only needed when mocking a module that is dynamically imported with
import()
(statically imported modules are fine)we previously avoided this with babel config via specifying a
noInterop: true
on a plugin called babel-plugin-dynamic-import-nodehere is the full Babel config
can you please provide an equivalent for swc config
our swc config is
Babel plugin or link to the feature description
No response
Additional context
No response