You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A content mapper turns `foo.gts` into virtual TypeScript, and declaration
emit names the result `foo.d.gts.ts` with `./foo.gts` kept in specifiers.
That is the only safe choice when nothing is known about the external
build. When that build compiles `foo.gts` to `foo.js`, the published
package needs `foo.d.ts` beside `foo.js`, and `.gts` specifiers do not
resolve for consumers that do not run the mapper.
`contentMappers[].outputExtension` (".js", ".mjs", or ".cjs") tells
TypeScript what the external build produces. With it set, declaration
emit names the file after the output (`foo.d.ts`, `foo.d.mts`,
`foo.d.cts`) and rewrites relative specifiers that resolved through the
mapper's extension to the output extension. Resolution, not string
matching, decides the rewrite, so a specifier that resolved to a sibling
`foo.d.gts.ts` is left alone. Any other value reports TS100069 on the
value in tsconfig.json.
The name collision from the issue (`app.ts` and `app.gts` both emitting
`app.d.ts`) is caught by the existing TS5056 output-path check.
JavaScript emit is unchanged: `rewriteRelativeImportExtensions` still
rewrites only TypeScript extensions.
Fixes#64053
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0188eg6bTrrUiWbj5FZaWH5Z
0 commit comments