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
Since esbuild 0.14.4 (0.14.5) a type-only export causes esbuild to apply the __toCommonJS() modifier to module.exports. this causes all other properties on module.exports to be overwritten.
I see that using export causes esbuild to apply the CJS transformation, but we were running into troubles because we use type only exports and those were removed without overwriting module.exports before v0.14.4.
Mixed CommonJS and ESM exports in the same file is not something esbuild is designed for. I added a warning in #1887 but that only checks for people doing module.exports = { a: 1 } not module.exports.bla = { a: 1 }. I can extend the warning to cover this case too.
Since esbuild 0.14.4 (0.14.5) a type-only export causes esbuild to apply the
__toCommonJS()
modifier to module.exports. this causes all other properties onmodule.exports
to be overwritten.I see that using
export
causes esbuild to apply the CJS transformation, but we were running into troubles because we use type only exports and those were removed without overwriting module.exports before v0.14.4.Here is what happens with 0.14.3:
and since 0.14.5 the behavior changed:
I tried to spot the change in the diff, but I only found this: v0.14.3...v0.14.5#diff-7c136e0e2ecad99566cc25cf7268b0537dadfe387e46eea3b7d82886e8875d84R1539, which is checking for an import, not an export.
Thanks for your work 🙏, do you think this is a bug or is this another interop ambiguity?
The text was updated successfully, but these errors were encountered: