Skip to content

Commit fbf8c17

Browse files
authored
doc(cloudflare): update type generation command (#130)
1 parent 77028b9 commit fbf8c17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pages/cloudflare/bindings.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ Add bindings to your Worker by adding them to your [wrangler configuration file]
4646
To ensure that the `env` object from `getCloudflareContext().env` above has accurate TypeScript types, run the following Wrangler command to [generate types that match your Worker's configuration](https://developers.cloudflare.com/workers/languages/typescript/#generate-types-that-match-your-workers-configuration-experimental):
4747

4848
```
49-
npx wrangler types --experimental-include-runtime
49+
npx wrangler types --env-interface CloudflareEnv
5050
```
5151

5252
This will generate a `d.ts` file and (by default) save it to `.wrangler/types/runtime.d.ts`. You will be prompted in the command's output to add that file to your `tsconfig.json`'s `compilerOptions.types` array.
5353

5454
If you would like to commit the file to git, you can provide a custom path. Here, for instance, the `runtime.d.ts` file will be saved to the root of your project:
5555

5656
```bash
57-
npx wrangler types --experimental-include-runtime="./runtime.d.ts"
57+
npx wrangler types --env-interface CloudflareEnv ./runtime.d.ts
5858
```
5959

60-
To ensure that your types are always up-to-date, make sure to run `wrangler types --experimental-include-runtime` after any changes to your config file.
60+
To ensure that your types are always up-to-date, make sure to run `wrangler types --env-interface CloudflareEnv` after any changes to your config file.
6161

6262
## Other Cloudflare APIs (`cf`, `ctx`)
6363

0 commit comments

Comments
 (0)