Skip to content

Commit c5e8a69

Browse files
authored
docs: document that extends can be an array
Updates the tsconfig extends option documentation to reflect that it can accept an array of strings (added in PR #50403). Includes explanation of left-to-right application order and adds example showing array usage. Fixes #62915
1 parent 4559775 commit c5e8a69

File tree

1 file changed

+16
-1
lines changed
  • packages/tsconfig-reference/copy/en/options

1 file changed

+16
-1
lines changed

packages/tsconfig-reference/copy/en/options/extends.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ display: "Extends"
33
oneline: "Specify one or more path or node module references to base configuration files from which settings are inherited."
44
---
55

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

9+
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.
10+
911
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.
1012

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

51+
`tsconfig.multiple.json`:
52+
53+
```json tsconfig
54+
{
55+
"extends": ["./configs/base", "./configs/strict"],
56+
"compilerOptions": {
57+
"outDir": "./dist"
58+
}
59+
}
60+
```
61+
62+
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.
63+
4964
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.

0 commit comments

Comments
 (0)