TypeScript Compiler Options

inlineSources — TypeScript compiler option

Embeds the original TypeScript source text in the sourcesContent field of JavaScript source maps. Works with either external or inline JavaScript maps; it does not itself enable map generation. Review whether shipping original source text is appropriate for the deployment. 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, dist/example.js.map. 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": {    "inlineSources": true  }}

Parameters & Attributes

NameTypeDescription
inlineSourcesbooleanSet 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",    "sourceMap": true,    "inlineSources": true  },  "files": [    "example.ts"  ]}// File: example.tsexport const count: number = 3;console.log(count);
TypeScript Reference