Reader small image

You're reading from  Mastering TypeScript - Fourth Edition

Product typeBook
Published inApr 2021
Reading LevelIntermediate
PublisherPackt
ISBN-139781800564732
Edition4th Edition
Languages
Right arrow
Author (1)
Nathan Rozentals
Nathan Rozentals
author image
Nathan Rozentals

Nathan Rozentals has been writing commercial software for over 30 years, in C, C++, Java and C#. He picked up TypeScript within a week after its initial release in October 2012 and realized how much TypeScript could help when writing JavaScript. He was one of the first people to start blogging about TypeScript, discussing early frameworks such as Backbone, Marionette, ExtJS and AngularJs. He knew he'd hit the mark when Microsoft staff started to reference his blog posts in their CodePlex discussion forums. Nathan's TypeScript solutions now control User Interfaces in IoT devices, run as stand-alone applications for Point-of-Sale solutions, provide complex application configuration web sites, and are used for mission-critical server APIs.
Read more about Nathan Rozentals

Right arrow

Nested configuration

The TypeScript compiler is able to re-use a tsconfig.json file in another directory when compiling code in the current directory. This feature is handy if we would like to override a compiler option when running tsc within a specific directory. The tsconfig.json file uses the "extends" option for this purpose. As an example of this nested configuration, consider the following source tree:

├── sub1
│   ├── SampleJsFile.js
│   └── tsconfig.json
├── SampleTsFile.ts
└── tsconfig.json

Here, we have a tsconfig.json file in the project root directory, as well as a TypeScript file named SampleTsFile.ts. We also have a subdirectory named sub1 that contains a tsconfig.json file, and a JavaScript file named SampleJsFile.js. The tsconfig.json file in the project root directory is as follows:

{
    "compilerOptions": {
   ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering TypeScript - Fourth Edition
Published in: Apr 2021Publisher: PacktISBN-13: 9781800564732

Author (1)

author image
Nathan Rozentals

Nathan Rozentals has been writing commercial software for over 30 years, in C, C++, Java and C#. He picked up TypeScript within a week after its initial release in October 2012 and realized how much TypeScript could help when writing JavaScript. He was one of the first people to start blogging about TypeScript, discussing early frameworks such as Backbone, Marionette, ExtJS and AngularJs. He knew he'd hit the mark when Microsoft staff started to reference his blog posts in their CodePlex discussion forums. Nathan's TypeScript solutions now control User Interfaces in IoT devices, run as stand-alone applications for Point-of-Sale solutions, provide complex application configuration web sites, and are used for mission-critical server APIs.
Read more about Nathan Rozentals