Skip to content

Commit 22e2a63

Browse files
Merge pull request #3207 from drewish/plugin-docs-fix
docs(plugins): Clarify how options are provided
2 parents d7f4d6d + 5f7e38f commit 22e2a63

File tree

3 files changed

+36
-21
lines changed

3 files changed

+36
-21
lines changed

content/graphql/cli-plugin.md

+15-8
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,22 @@ To enable the plugin, open `nest-cli.json` (if you use [Nest CLI](/cli/overview)
9999
You can use the `options` property to customize the behavior of the plugin.
100100

101101
```javascript
102-
"plugins": [
103-
{
104-
"name": "@nestjs/graphql",
105-
"options": {
106-
"typeFileNameSuffix": [".input.ts", ".args.ts"],
107-
"introspectComments": true
108-
}
102+
{
103+
"collection": "@nestjs/schematics",
104+
"sourceRoot": "src",
105+
"compilerOptions": {
106+
"plugins": [
107+
{
108+
"name": "@nestjs/graphql",
109+
"options": {
110+
"typeFileNameSuffix": [".input.ts", ".args.ts"],
111+
"introspectComments": true
112+
}
113+
}
114+
]
109115
}
110-
]
116+
}
117+
111118
```
112119

113120
The `options` property has to fulfill the following interface:

content/openapi/cli-plugin.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,21 @@ To enable the plugin, open `nest-cli.json` (if you use [Nest CLI](/cli/overview)
144144
You can use the `options` property to customize the behavior of the plugin.
145145

146146
```javascript
147-
"plugins": [
148-
{
149-
"name": "@nestjs/swagger",
150-
"options": {
151-
"classValidatorShim": false,
152-
"introspectComments": true
153-
}
147+
{
148+
"collection": "@nestjs/schematics",
149+
"sourceRoot": "src",
150+
"compilerOptions": {
151+
"plugins": [
152+
{
153+
"name": "@nestjs/swagger",
154+
"options": {
155+
"classValidatorShim": false,
156+
"introspectComments": true
157+
}
158+
}
159+
]
154160
}
155-
]
161+
}
156162
```
157163

158164
The `options` property has to fulfill the following interface:

content/recipes/swc.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ Instead of passing the `-b` flag you can also just set the `compilerOptions.buil
3737
To customize builder's behavior, you can pass an object containing two attributes, `type` (`"swc"`) and `options`, as follows:
3838

3939
```json
40-
"compilerOptions": {
41-
"builder": {
42-
"type": "swc",
43-
"options": {
44-
"swcrcPath": "infrastructure/.swcrc",
40+
{
41+
"compilerOptions": {
42+
"builder": {
43+
"type": "swc",
44+
"options": {
45+
"swcrcPath": "infrastructure/.swcrc",
46+
}
4547
}
4648
}
4749
}

0 commit comments

Comments
 (0)