Summary
Support string literals in named exports (e.g. export { foo as "module.exports" })
Repro steps
Use '@microsoft/api-extractor' to bundle a list of type definition files.
One of which contains a string literal named export
Expected result:
https://www.typescriptlang.org/play/?ts=5.9.3#code/MYewdgzgLgBAZiEMC8MDkAjAhgJzQbgChCBTADwAcQdYBveRGLCdAWxABMBXAGxIDpyVGhDQwAvkA
declare const foo = "bar";
export { foo as 'module.exports' };
Actual result:
declare const foo = "bar";
export { foo as module.exports };
Details
See: https://joyeecheung.github.io/blog/2025/12/30/require-esm-in-node-js-implementers-tales/
Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question |
Answer |
@microsoft/api-extractor version? |
latest |
| Operating system? |
max |
| API Extractor scenario? |
rollups |
| Would you consider contributing a PR? |
No |
| TypeScript compiler version? |
latest |
Node.js version (node -v)? |
latest |