Skip to content

Commit 75615f3

Browse files
authored
docs(start): fix cloudflare-workers deployment using wrangler.toml (#4779)
1 parent e8599c6 commit 75615f3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/start/framework/react/hosting.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ When deploying to Cloudflare Workers, you'll need to complete a few extra steps
8080

8181
1. Update `vite.config.ts`
8282

83-
Set the `target` value to `cloudflare-pages` in your `vite.config.ts` file.
83+
Set the `target` value to `cloudflare-module` in your `vite.config.ts` file.
8484

8585
```ts
8686
// vite.config.ts
@@ -97,12 +97,16 @@ export default defineConfig({
9797
```toml
9898
# wrangler.toml
9999
name = "your-cloudflare-project-name"
100-
pages_build_output_dir = "./dist"
100+
main = "./.output/server/index.mjs"
101+
compatibility_date = "2025-04-01"
101102
compatibility_flags = ["nodejs_compat"]
102-
compatibility_date = "2024-11-13"
103+
104+
[assets]
105+
binding = "ASSETS"
106+
directory = "./.output/public"
103107
```
104108

105-
Deploy your application to Cloudflare Pages using their one-click deployment process, and you're ready to go!
109+
Deploy your application to Cloudflare Workers using their one-click deployment process, and you're ready to go!
106110

107111
### Node.js
108112

0 commit comments

Comments
 (0)