-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "syntheticNamedExports"? #1919
Comments
No, I'm not planning on supporting that feature at the moment. That's not how the JavaScript specification works and esbuild tries to follow the specification. Note that esbuild's bundler already supports importing named exports from CommonJS modules without needing a mechanism like this. |
Yes esbuild can bundle cjs module with named imports, with the downside of no tree-shaking on the cjs modules. This feature allows to mark a named export in es module as "module.exports", so that the input are all esm and tree-shaking still happens. Rollup made this to support re-export in its commonjs plugin, so that it doesn't have to analyse too deep. I recently tried to repeat that plugin in esbuild and find that it requires such feature to be enabled in plugin side. Anyway, it's ok if you're not planning to support it. |
Closing as out of scope. |
It is about importing named exports from commonjs modules, similar to this rollup feature.
It's good to know if you plan to support this feature, or as non-goal.
The text was updated successfully, but these errors were encountered: