Closed Shingyx closed 5 years ago
We're not going to change the behavior of the builtin interop default import helper - it very intentionally matches the behavior of babel's default import helper.
I see. I opened this PR because I ran into the issue again recently and I didn't get feedback when I suggested this in the linked issue.
I'll close this PR. Cheers.
This is done by changing the
__importDefault
helper to import a module as-is only if the module has "default" defined.This is a workaround for the error described in https://github.com/Microsoft/TypeScript/issues/27329. See https://github.com/Shingyx/esmoduleinterop-runtime-error for a sample project which demonstrates the runtime error.