Skip to content

Commit b71a6a9

Browse files
dario-piotrowiczpetebacondarwinToriLindsay
authored
add --strict-vars option to the wrangler types command (#18981)
--------- Co-authored-by: Pete Bacon Darwin <[email protected]> Co-authored-by: ToriLindsay <[email protected]>
1 parent 482b1a2 commit b71a6a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,10 @@ The minimum required Wrangler version to use this command is 3.66.0.
18231823
- Leave the path blank to use the default option, e.g. `npx wrangler types --x-include-runtime`
18241824
- A custom path must be relative to the project root, e.g. `./my-runtime-types.d.ts`
18251825
- A custom path must have a `d.ts` extension.
1826+
- `--strict-vars` <Type text="boolean" /> <MetaInfo text="optional (default: true)" />
1827+
- Control the types that Wrangler generates for `vars` bindings.
1828+
- If `true`, (the default) Wrangler generates literal and union types for bindings (e.g. `myEnv: 'my dev variable' | 'my prod variable'`).
1829+
- If `false`, Wrangler generates generic types (e.g. `myEnv: string`). This is useful when variables change frequently, especially when working across multiple environments.
18261830

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

0 commit comments

Comments
 (0)