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
swc exports the incorrect value when the interopRequireDefault helper is applied to a separate import from the same library
Input code
Reproducible using the API
constswc=require(`@swc/wasm`);console.log(swc.transformSync(`import semver from 'semver';export {SemVer} from 'semver';export function foo() { return new semver.SemVer('');}`,{module: {type: `commonjs`},jsc: {externalHelpers: true,},}).code);
The output exports _semver.SemVer instead of _semver.default.SemVer
I think we may need to revise the description of this issue. The exported value should actually be require('semver').SemVer, at least according to TypeScript's behavior:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Describe the bug
swc exports the incorrect value when the
interopRequireDefault
helper is applied to a separate import from the same libraryInput code
Reproducible using the API
The output exports
_semver.SemVer
instead of_semver.default.SemVer
Config
n/a
Expected behavior
Version
The version of @swc/wasm: 1.2.58
Additional context
yarnpkg/berry#2228
The text was updated successfully, but these errors were encountered: