Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion packages/tsconfig-reference/copy/en/options/extends.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ display: "Extends"
oneline: "Specify one or more path or node module references to base configuration files from which settings are inherited."
---

The value of `extends` is a string which contains a path to another configuration file to inherit from.
The value of `extends` is a string or array of strings which contains a path to another configuration file to inherit from.
The path may use Node.js style resolution.

When using an array, the configurations are applied from left to right, with later entries overriding earlier ones. This allows you to compose multiple base configurations together.

The configuration from the base file are loaded first, then overridden by those in the inheriting config file. All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.

It's worth noting that [`files`](#files), [`include`](#include), and [`exclude`](#exclude) from the inheriting config file _overwrite_ those from the
Expand Down Expand Up @@ -46,4 +48,17 @@ Currently, the only top-level property that is excluded from inheritance is [`re
}
```

`tsconfig.multiple.json`:

```json tsconfig
{
"extends": ["./configs/base", "./configs/strict"],
"compilerOptions": {
"outDir": "./dist"
}
}
```

Properties with relative paths found in the configuration file, which aren't excluded from inheritance, will be resolved relative to the configuration file they originated in.

Properties with relative paths found in the configuration file, which aren't excluded from inheritance, will be resolved relative to the configuration file they originated in.