fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Do not assign named exports into existing default export

Open CertainLach opened this issue 5 months ago • 1 comments

Fixes: https://github.com/denoland/fresh/issues/3492

CertainLach avatar Sep 25 '25 16:09 CertainLach

Note that this change is potentially breaking, but I don't think the code that might be broken by it was processed correctly in the first place, in case of existing default export, the old implementation was setting static properties on it, this isn't how esm compat works in node.js/with syntheticDefaultExport works for example.

I see that babel might emit this in loose mode:

module.exports = MyClass;
module.exports.default = MyClass;

But I don't see anything that needs to be done when going backwards

CertainLach avatar Sep 25 '25 16:09 CertainLach