1.0.3 • Published 1 year ago

@rubennl/vite-plugin-graphql-codegen-optimized v1.0.3

Weekly downloads
-
License
-
Repository
gitlab
Last release
1 year ago

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)

OptionTypeDefaultDescription
codegenConfigFilestringAuto detected by @graphql-codegen/cliThe name of the codegen config file
outputPathstringAuto detectedFilter used to detect if a file should be processed
reloadDelaynumber100The delay in ms before the browser reloads. Set to -1 to use vite default, or disable
showPopupsbooleantrueShow popups in the browser when something goes wrong
runOnStartbooleantrueRun the codegen on vite startup
showSuggestionsbooleantrueShow suggestions to improve performance
watchSchemabooleantrueWatch the schema file(s) for changes
restartAfterGeneratebooleantrueRestart Vite when the codegen is done. Disabling this isn't recommended or guaranteed to work
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.9-dev

1 year ago

0.0.8-dev

1 year ago

0.0.7-dev

1 year ago

0.0.6-dev

1 year ago

0.0.5-dev

1 year ago

0.0.4-dev

1 year ago

0.0.3-dev

1 year ago

0.0.2-dev

1 year ago

0.0.1-dev

1 year ago