{"componentChunkName":"component---src-templates-handbook-tsx","path":"/docs/handbook/tsconfig-json.html","result":{"data":{"markdownRemark":{"id":"b8385d1d-f56e-5084-b337-419e7203bbe8","excerpt":"Overview The presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project.\nThe tsconfig.json file specifies…","html":"<h2 id=\"overview\"><a href=\"#overview\" aria-label=\"overview permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Overview</h2>\n<p>The presence of a <code>tsconfig.json</code> file in a directory indicates that the directory is the root of a TypeScript project.\nThe <code>tsconfig.json</code> file specifies the root files and the compiler options required to compile the project.\nA project is compiled in one of the following ways:</p>\n<h2 id=\"using-tsconfigjson\"><a href=\"#using-tsconfigjson\" aria-label=\"using tsconfigjson permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Using tsconfig.json</h2>\n<ul>\n<li>By invoking tsc with no input files, in which case the compiler searches for the <code>tsconfig.json</code> file starting in the current directory and continuing up the parent directory chain.</li>\n<li>By invoking tsc with no input files and a <code>--project</code> (or just <code>-p</code>) command line option that specifies the path of a directory containing a <code>tsconfig.json</code> file, or a path to a valid <code>.json</code> file containing the configurations.</li>\n</ul>\n<p>When input files are specified on the command line, <code>tsconfig.json</code> files are ignored.</p>\n<h2 id=\"examples\"><a href=\"#examples\" aria-label=\"examples permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Examples</h2>\n<p>Example <code>tsconfig.json</code> files:</p>\n<ul>\n<li>\n<p>Using the <code>\"files\"</code> property</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"module\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"commonjs\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"noImplicitAny\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"removeComments\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"preserveConstEnums\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"sourceMap\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">},</span>\n<span style=\"color: #0451A5\">\"files\"</span><span style=\"color: #000000\">: [</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"core.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"sys.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"types.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"scanner.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"parser.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"utilities.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"binder.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"checker.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"emitter.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"program.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"commandLineParser.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"tsc.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #A31515\">\"diagnosticInformationMap.generated.ts\"</span>\n<span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</li>\n<li>\n<p>Using the <code>\"include\"</code> and <code>\"exclude\"</code> properties</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"module\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"system\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"noImplicitAny\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"removeComments\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"preserveConstEnums\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"outFile\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"../../built/local/tsc.js\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"sourceMap\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">},</span>\n<span style=\"color: #0451A5\">\"include\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"src/**/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #0451A5\">\"exclude\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"node_modules\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"**/*.spec.ts\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</li>\n</ul>\n<h2 id=\"details\"><a href=\"#details\" aria-label=\"details permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Details</h2>\n<p>The <code>\"compilerOptions\"</code> property can be omitted, in which case the compiler’s defaults are used. See our full list of supported <a href=\"/v2/en/tsconfig\">Compiler Options</a>.</p>\n<h2 id=\"schema\"><a href=\"#schema\" aria-label=\"schema permalink\" class=\"anchor\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Schema</h2>\n<p>Schema can be found at: <a href=\"http://json.schemastore.org/tsconfig\">http://json.schemastore.org/tsconfig</a></p>","headings":[{"value":"Overview","depth":2},{"value":"Using tsconfig.json","depth":2},{"value":"Examples","depth":2},{"value":"Details","depth":2},{"value":"Schema","depth":2}],"frontmatter":{"permalink":"/docs/handbook/tsconfig-json.html","title":"tsconfig.json"}}},"pageContext":{"slug":"/docs/handbook/tsconfig-json.html","isOldHandbook":true}}}