Skip to content

Commit a79228b

Browse files
docs(types) mention computed object key syntax and correct existing case (#3323)
1 parent f199d85 commit a79228b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/content/concepts/entry-points.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This is a great choice when you are looking to quickly setup a webpack configura
4444

4545
## Object Syntax
4646

47-
Usage: `entry: { [entryChunkName] string [string] }`
47+
Usage: `entry: { <entryChunkName> string | [string] }`
4848

4949
__webpack.config.js__
5050

src/content/contribute/writers-guide.md

+10
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,13 @@ To mark a number, use `number`:
206206
To mark an object, use `object`:
207207

208208
`object = { prop1 string = 'none': 'none' | 'development' | 'production', prop2 boolean = false, prop3 function (module) => string }`
209+
210+
When object's key can have multiple types, use `|` to list them. Here is an example, where `prop1` can be both a string and an array of strings:
211+
212+
`object = { prop1 string = 'none': 'none' | 'development' | 'production' | [string]}`
213+
214+
This allows us to display the defaults, enumeration and other information.
215+
216+
If the object's key is dynamic, user-defined, use `<key>` to describe it:
217+
218+
`object = { <key> string }`

0 commit comments

Comments
 (0)