-
@ije When I run parseCjsExports on "react" it returns
... the generated code fails with "default" not being defined on the export. However, if we add the following line (which would be done if exportDefault: true):
Everything seems OK. Shouldn't the result of that script be exportDefault: true? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
cjs always has the default export as esm, unless the const React = require("react")
export default React
export { createElement, ... } = React |
Beta Was this translation helpful? Give feedback.
-
@ije Ok, thanks. Where is that defined? I'm looking here but don't see it: https://github.com/esm-dev/esm.sh/blob/3324cc705a282b0bf7ae7ebcd15495fed838ace5/server/server_handler.go#L1286C1-L1286C25 |
Beta Was this translation helpful? Give feedback.
check https://github.com/esm-dev/esm.sh/blob/main/server/build.go#L255-L262