-
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
Feature request: deep analysed annotations for cjs -> esm #2486
Comments
FYI, nodejs uses cjs-module-lexer to lexically analyze source code to find exports. So we have several choices:
|
It's probably possible to do this without modifying 0 && (module.exports = {
...require('package-x'),
/* other exports */
}); This approach would also have the benefit of automatically working with older node versions which wouldn't ever get any fixes that might hypothetically be added to |
This seems to me a far better approach, will you make this extra annotation in esbuild? |
Currently esbuild generate annotations for nodejs' cjs to esm lexer, which works well.
But if the input js file contains something like
export * from 'package-x'
,The exports of package-x is not in the annotation.
will it be possible for esbuild to read the exports of package-x and "re-emit" in the annotation of output file?
The text was updated successfully, but these errors were encountered: