Skip to content

Commit 96f1a59

Browse files
committed
docs: more about extensions
1 parent 6c0406c commit 96f1a59

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/guide/intro/extensions.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,34 +46,46 @@ api:
4646

4747
This will safely resolve to an object `{ url: string, timeout: number }` by merging sibling keys.
4848

49+
Note that `$env` is aware of environment name aliases as well. See [meta file](./settings.md#parse-and-loading-configuration)
50+
for how to change the environmentSourceNames or environmentAliases.
51+
4952
## The `$extends` Directive
5053

5154
Merges (deeply) values from another file. The current file has precedent when merging.
5255

5356
```yaml
57+
# Use it with a file path
5458
$extends: './other-file.yml'
5559
60+
# Or use it with options
5661
nested:
5762
propertyA:
5863
$extends:
5964
path: ./other-file.yml
6065
optional: true
6166
select: 'foo.bar'
67+
68+
# An array also works
69+
$extends:
70+
- ./file1.yml
71+
- ./file2.yml
6272
```
6373

64-
This option can be given a string (filepath), an object with options, or an array of objects.
74+
This option can be given a filepath, an object with options, or an array of objects.
6575

66-
`select` allows extending a sub-object and `optional` allows missing files. These are optional.
76+
`select` allows extending a property from the other file, and `optional` allows missing files.
6777

6878
## The `$override` Directive
6979

7080
The override directive is exactly the same as `$extends`, except that the other file takes precedent when merging.
7181
This is useful for the pattern:
7282

7383
```yaml
84+
# if present, the values in this file will override the ones here
7485
$override:
7586
path: /etc/my-app/config.yml
7687
optional: true
88+
7789
# ... default values
7890
```
7991

0 commit comments

Comments
 (0)