TypeScript Compiler Options
inlineSourceMap — TypeScript compiler option
Embeds the generated JavaScript source map as a data URL in a sourceMappingURL comment, instead of writing a separate map file. This increases the JavaScript file size; it does not include original source text unless inlineSources is enabled. Default: False when omitted. Create the named files in a clean local project and run tsc -p tsconfig.json. Expected emitted files: dist/example.js. Run node dist/example.js; expected stdout: '3'. Tested with TypeScript 5.8.3 and Node.js 22.16.0; local project example, not a single-file editor.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "inlineSourceMap": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| inlineSourceMap | boolean | Set in compilerOptions; False when omitted. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmitOnError": true, "outDir": "dist", "inlineSourceMap": true }, "files": [ "example.ts" ]}// File: example.tsexport const count: number = 3;console.log(count);