You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/local-development/index.mdx
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,22 +17,28 @@ You can test changes locally using the following:
17
17
18
18
Both approaches aim to provide confidence that your local environment will closely match the production runtime, removing the need to [test against remote resources](#develop-using-remote-resources-and-bindings).
19
19
20
-
## Choosing Between Wrangler and the Vite Plugin
20
+
## Choosing Between Wrangler and Vite
21
21
22
-
When you are building with Cloudflare Workers, choosing between Wrangler and the Cloudflare Vite plugin primarily depends on your project’s scope and development workflow. Below are some guidelines to help you decide which toolset to use.
22
+
Deciding between Wrangler and the Cloudflare Vite plugin depends on your project's focus and development workflow. Here are some quick guidelines to help you choose:
23
23
24
-
### When to use Wrangler
24
+
### When to use Wrangler:
25
25
26
-
-**Backend and Workers-focused development:** Ideal if your primary goal is to build serverless functions, APIs, or other background tasks that need to closely resemble production behavior. Wrangler provides the most accurate local simulation of Cloudflare’s runtime.
26
+
-**Backend & Workers-focused:**
27
+
If you're primarily building APIs, serverless functions, or background tasks that need to closely match production behavior, use Wrangler. Wrangler offers the most accurate local simulation of Cloudflare’s runtime.
27
28
28
-
-**Testing with real Cloudflare resources:** If you need to verify interactions with actual Cloudflare data or services, Wrangler’s `--remote` flag lets you test in a production-like environment without deploying your app fully to production.
29
+
-**Real Cloudflare resources:**
30
+
Need to test actual Cloudflare data or services? Wrangler’s `--remote` flag lets you do so without fully deploying to production.
29
31
30
-
-**Limited frontend requirements:** Wrangler is well suited for simple or minimal frontend needs, where complex bundling and advanced development features (like Hot Module Replacement) are not critical.
32
+
-**Simple frontends:**
33
+
If you have minimal frontend requirements and don’t need hot reloading or advanced bundling, Wrangler by itself is sufficient.
31
34
32
-
### When to use the Cloudflare Vite Plugin
35
+
### When to use the Cloudflare Vite Plugin:
33
36
34
-
-**Frontend-intensive developmentL** If your application relies heavily on modern frontend [frameworks](/workers/frameworks/) — such as React, Vue, Svelte, or Solid — the Vite plugin makes setup and configuration straightforward.
37
+
-**Frontend-centric development:**
38
+
If you rely on modern frameworks like React, Vue, Svelte, or Solid, the Vite plugin simplifies setup and integration.
35
39
36
-
-**Rapid iteration with HMR:** Hot Module Replacement (HMR) provides near-instant reloads whenever you make changes. This speeds up development by letting you see updates in the browser without a full page refresh.
40
+
-**Rapid iteration (HMR):**
41
+
If you need near-instant updates in the browser, the Vite plugin provides Hot Module Replacement (HMR) during local development.
37
42
38
-
-**Advanced frontend optimizations**: The Vite plugin supports tree-shaking, code splitting, efficient bundling, CSS handling, and caching strategies. If you require optimized frontend delivery — especially for large or complex UIs — Vite is a strong fit.
43
+
-**Advanced optimizations:**
44
+
If you require more advanced optimizations (tree-shaking, code splitting, efficient bundling, CSS handling, etc), Vite is a strong fit.
Copy file name to clipboardExpand all lines: src/content/docs/workers/local-development/vite.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ import {
16
16
WranglerConfig,
17
17
} from"~/components";
18
18
19
+
## Local development with Vite
20
+
19
21
The Cloudflare Vite plugin (`@cloudflare/vite-plugin`) integrates your Worker code directly with [Vite](https://vite.dev/). Like `wrangler dev`, this approach uses `workerd` under the hood as well, and provides:
20
22
21
23
- Direct access to Workers [runtime APIs](/workers/runtime-apis/) and [bindings](/workers/runtime-apis/bindings/)
0 commit comments