You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Experimental zero-config vite plugin that uses the vite file watcher to run [gra
6
6
7
7
Installation instructions found [here](https://www.graphql-code-generator.com/docs/getting-started/installation). Optional if already set up in project.
8
8
9
-
## Install
9
+
## Install Plugin
10
10
11
11
```bash
12
12
# npm
@@ -16,7 +16,7 @@ npm i -D vite-plugin-graphql-codegen
16
16
yarn add -D vite-plugin-graphql-codegen
17
17
```
18
18
19
-
## Initialize
19
+
## Initialize Plugin
20
20
21
21
```js
22
22
# vite.config.ts
@@ -31,4 +31,19 @@ export default defineConfig({
31
31
});
32
32
```
33
33
34
+
## Options
35
+
36
+
Providing options is not required as sensible defaults are in place, but there may be times where it's helpful to disable codegen under certain circumstances, like when running builds in CI.
37
+
38
+
```js
39
+
codegen({
40
+
/* Should codegen run when the dev server starts. Defaults to true. */
41
+
runOnStart:true,
42
+
/* Should codegen run on build. Will prevent build if codegen fails. Defaults to true. */
43
+
runOnBuild:true,
44
+
/* Should codegen run when files get added or change. Defaults to true. */
45
+
enableWatcher:true
46
+
})
47
+
```
48
+
34
49
Project bootstrapped with [TSDX](https://github.com/palmerhq/tsdx).
0 commit comments