For example:
Refer official documentation https://www.typescriptlang.org/docs/han ... th-extends
Here you can see :
A tsconfig.json file can inherit configurations from another file using the extends property.
The extends is a top-level property in tsconfig.json (alongside compilerOptions, files, include, and exclude). extends’ value is a string containing a path to another configuration file to inherit from.
The configuration from the base file are loaded first, then overridden by those in the inheriting config file. If a circularity is encountered, we report an error.
files, include and exclude from the inheriting config file overwrite those from the base config file.
All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.
For example:
configs/base.json:
Code: Select all
{
"compilerOptions": {
"noImplicitAny": true,
"strictNullChecks": true
}
}
Code: Select all
{
"extends": "./configs/base",
"files": [
"main.ts",
"supplemental.ts"
]
}
Code: Select all
{
"extends": "./tsconfig",
"compilerOptions": {
"strictNullChecks": false
}
}
Code: Select all
{
build:appX="cp tsconfig.x.json tsconfig.json && npm run build"
build:appY="cp tsconfig.y.json tsconfig.json && npm run build"
}