Skip to content

Commit 1424b4d

Browse files
committed
add TypeScript section
1 parent 4fab115 commit 1424b4d

File tree

1 file changed

+29
-0
lines changed
  • src/content/docs/workers/framework-guides/web-apps

1 file changed

+29
-0
lines changed

src/content/docs/workers/framework-guides/web-apps/vike.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,32 @@ declare global {
211211
> args="--react --hono --drizzle --cloudflare"
212212
> />
213213
> Or go to [vike.dev/new](https://vike.dev/new) and select `Cloudflare` with an ORM.
214+
215+
216+
## TypeScript
217+
218+
If you use TypeScript, (re-)run [`wrangler types`](https://developers.cloudflare.com/workers/wrangler/commands/#types) after changing your Cloudflare configuration to generate/update the `worker-configuration.d.ts` file.
219+
220+
<PackageManagers
221+
type="exec"
222+
pkg="wrangler"
223+
args="types"
224+
/>
225+
226+
Then commit it:
227+
228+
```bash
229+
git commit -am "update cloudflare types"
230+
```
231+
232+
Make sure TypeScript loads it:
233+
234+
```diff lang=json title="tsconfig.json"
235+
{
236+
"compilerOptions": {
237+
+ "types": ["./worker-configuration.d.ts"],
238+
}
239+
}
240+
```
241+
242+
See also: [Cloudflare Workers > TypeScript](https://developers.cloudflare.com/workers/languages/typescript/)

0 commit comments

Comments
 (0)