ESM imports in TypeScript
ESM imports in TypeScript
Section titled “ESM imports in TypeScript”"type": "module"inpackage.jsonfor ESM packages (this repo).- Relative imports must use a
.jsextension in the specifier (e.g.from './foo.js') so emitted JavaScript resolves at runtime. - Do not commit hand-edited
.jsnext to.tssources.
More: Agent golden rules.