1.0.3 • Published 2 years ago
@rubennl/vite-plugin-graphql-codegen-optimized v1.0.3
Vite-plugin-graphql-codegen-optimized
This project is heavily inspired by vite-plugin-graphql-codegen, but with some optimizations/fixes.
Changes compared to the original plugin
- Only runs the generator when a query is actually changed, not on every unrelated file change.
- Shows errors in the browser, which makes development easier
- Restarts are more reliable
Missing features
(Got any ideas? Open an issue!)
Usage
Add the plugin to your vite.config.ts file:
import codegen from "@rubennl/vite-plugin-graphql-codegen-optimized";
export default defineConfig({
plugins: [
codegen()
]
});Options (all optional)
| Option | Type | Default | Description |
|---|---|---|---|
codegenConfigFile | string | Auto detected by @graphql-codegen/cli | The name of the codegen config file |
outputPath | string | Auto detected | Filter used to detect if a file should be processed |
reloadDelay | number | 100 | The delay in ms before the browser reloads. Set to -1 to use vite default, or disable |
showPopups | boolean | true | Show popups in the browser when something goes wrong |
runOnStart | boolean | true | Run the codegen on vite startup |
showSuggestions | boolean | true | Show suggestions to improve performance |
watchSchema | boolean | true | Watch the schema file(s) for changes |
restartAfterGenerate | boolean | true | Restart Vite when the codegen is done. Disabling this isn't recommended or guaranteed to work |
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.9-dev
2 years ago
0.0.8-dev
2 years ago
0.0.7-dev
2 years ago
0.0.6-dev
2 years ago
0.0.5-dev
2 years ago
0.0.4-dev
2 years ago
0.0.3-dev
2 years ago
0.0.2-dev
2 years ago
0.0.1-dev
2 years ago
0.0.1-dev.COMMITHASH
2 years ago