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/wrangler/configuration.mdx
+32-4Lines changed: 32 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,8 @@ The majority of keys are inheritable, meaning that top-level configuration can b
61
61
62
62
Further, there are a few keys that can _only_ appear at the top-level.
63
63
64
+
With the [Cloudflare Vite plugin](/workers/local-development/vite/), you select a Wrangler environment at dev or build time via the `CLOUDFLARE_ENV` environment variable. Otherwise, environments are defined in your Wrangler config file as usual. For more detail on using Wrangler environments with the Cloudflare Vite plugin, refer to the [plugin documentation](/workers/local-development/vite#environments).
65
+
64
66
## Top-level only keys
65
67
66
68
Top-level keys apply to the Worker as a whole (and therefore all environments). They cannot be defined within named environments.
@@ -80,6 +82,7 @@ Top-level keys apply to the Worker as a whole (and therefore all environments).
- An ordered list of rules that define which modules to import, and what type to import them as. You will need to specify rules to use `Text`, `Data` and `CompiledWasm` modules, or when you wish to have a `.js` file be treated as an `ESModule` instead of `CommonJS`.
144
+
- Not applicable if you're using the [Cloudflare Vite plugin](/workers/local-development/vite/).
- The directory in which module "rules" should be evaluated when including additional files (via `find_additional_modules`) into a Worker deployment. Defaults to the directory containing the `main` entry point of the Worker if not specified.
167
+
- Not applicable if you're using the [Cloudflare Vite plugin](/workers/local-development/vite/).
- Not required if you're using the [Cloudflare Vite plugin](/workers/local-development/vite/), which will automatically point to the client build output.
You can configure Wrangler to replace all calls to import a particular package with a module of your choice, by configuring the `alias` field:
1121
1146
@@ -1193,6 +1218,7 @@ In many cases, this allows you to work provide just enough of an API to make a d
1193
1218
-`upload_source_maps` <Typetext="boolean" />
1194
1219
1195
1220
- When `upload_source_maps` is set to `true`, Wrangler will automatically generate and upload source map files when you run [`wrangler deploy`](/workers/wrangler/commands/#deploy) or [`wrangler versions deploy`](/workers/wrangler/commands/#deploy-2).
1221
+
- Not applicable if you're using the [Cloudflare Vite plugin](/workers/local-development/vite/).
1196
1222
1197
1223
Example:
1198
1224
@@ -1277,6 +1303,8 @@ This section describes a feature that can be implemented by frameworks and other
1277
1303
1278
1304
It is unlikely that an application developer will need to use this feature, but it is documented here to help you understand when Wrangler is using a generated configuration rather than the original, user's configuration.
1279
1305
1306
+
For example, when you are using the [Cloudflare Vite plugin](/workers/local-development/vite/), it will generate a Wrangler configuration file when you run `vite build`, which is then used for preview and deployment.
1307
+
1280
1308
:::
1281
1309
1282
1310
Some framework tools, or custom pre-build processes, generate a modified Wrangler configuration to be used to deploy the Worker code.
You should use [Workers Static Assets](/workers/static-assets/) to host full-stack applications instead of Workers Sites. Do not use Workers Sites for new projects.
7
+
You should use [Workers Static Assets](/workers/static-assets/) to host full-stack applications instead of Workers Sites. It has been deprecated in Wrangler v4, and the [Cloudflare Vite plugin](/workers/local-development/vite) does not support Workers Sites. Do not use Workers Sites for new projects.
0 commit comments