Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --strict-vars option to the wrangler types command #18981

Merged
merged 8 commits into from
Jan 21, 2025
4 changes: 4 additions & 0 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,10 @@ The minimum required Wrangler version to use this command is 3.66.0.
- Leave the path blank to use the default option, e.g. `npx wrangler types --x-include-runtime`
- A custom path must be relative to the project root, e.g. `./my-runtime-types.d.ts`
- A custom path must have a `d.ts` extension.
- `--strict-vars` <Type text="boolean" /> <MetaInfo text="optional (default: true)" />
- Control the types that Wrangler generates for `vars` bindings.
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.

<Render file="wrangler-commands/global-flags" product="workers" />

Expand Down
Loading