Declaration Files
tship generates declaration files (*.d.ts) for each format only when declaration is enabled in your tsconfig.json.
Structure
When directories are separate:
dist/cjs/index.d.tsdist/esm/index.d.ts
When sharing a folder:
dist/index.d.ctsdist/index.d.mts
Respecting tsconfig.json Options
tship fully respects your tsconfig.json settings:
- If
declarationisfalseor not set → no.d.tsfiles are emitted. - If
declarationMapisfalseor not set → no.d.ts.mapfiles are emitted. - If
sourceMapisfalseor not set → no.js.mapfiles are emitted.
This ensures tship only produces what you explicitly asked for.
Source Maps
When enabled, source maps and declaration maps are generated and correctly reference the output files. If files are renamed (when formats share a directory), the source map references are updated automatically.