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/vite-plugin/migrating-from-wrangler-dev.mdx
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,25 +7,24 @@ sidebar:
7
7
description: Migrating from wrangler dev to the Vite plugin
8
8
---
9
9
10
-
In most cases, migrating from `wrangler dev` is straightforward and you can follow the instructions in [Get started](/workers/vite-plugin/get-started/).
10
+
In most cases, migrating from [`wrangler dev`](/workers/wrangler/commands/#dev) is straightforward and you can follow the instructions in [Get started](/workers/vite-plugin/get-started/).
11
11
There are a few key differences to highlight:
12
12
13
13
### Input and output Worker config files
14
14
15
-
With the Cloudflare Vite plugin, your Worker config file (for example, `wrangler.jsonc`) is the input configuration and a separate output configuration is created as part of the build.
15
+
With the Cloudflare Vite plugin, your [Worker config file](/workers/wrangler/configuration/) (for example, `wrangler.jsonc`) is the input configuration and a separate output configuration is created as part of the build.
16
16
This output file is a snapshot of your configuration at the time of the build and is modified to reference your build artifacts.
17
17
It is the configuration that is used for preview and deployment.
18
18
Once you have run `vite build`, running `wrangler deploy` or `vite preview` will automatically locate this output configuration file.
19
19
20
20
### Cloudflare Environments
21
21
22
-
With the Cloudflare Vite plugin, Cloudflare environments are applied at dev and build time.
22
+
With the Cloudflare Vite plugin, [Cloudflare Environments](/workers/vite-plugin/cloudflare-environments/) are applied at dev and build time.
23
23
Running `wrangler deploy --env some-env` is therefore not applicable and the environment to deploy should instead be set by running `CLOUDFLARE_ENV=some-env vite build`.
24
-
See [Cloudflare Environments](/workers/vite-plugin/cloudflare-environments/) for more information.
25
24
26
25
### Redundant fields in the Wrangler config file
27
26
28
-
There are various options in the Worker config file that are ignored when using Vite, as they are either no longer applicable or are replaced by Vite equivalents.
27
+
There are various options in the [Worker config file](/workers/wrangler/configuration/) that are ignored when using Vite, as they are either no longer applicable or are replaced by Vite equivalents.
29
28
If these options are provided, then warnings will be printed to the console with suggestions for how to proceed.
30
29
Examples where the Vite configuration should be used instead include `alias` and `define`.
31
30
See [Vite Environments](/workers/vite-plugin/vite-environments/) for more information about configuring your Worker environments in Vite.
Secrets are typically used for storing sensitive information like API keys an auth tokens.
12
+
[Secrets](/workers/configuration/secrets/) are typically used for storing sensitive information like API keys an auth tokens.
13
13
For deployed Workers, they are set via the dashboard or Wrangler CLI.
14
-
See [Secrets](/workers/configuration/secrets/) for more information.
15
14
16
15
In local development, secrets can be provided to your Worker by using a [`.dev.vars`](/workers/configuration/secrets/#local-development-with-secrets) file.
17
16
If you are using [Cloudflare Environments](/workers/vite-plugin/cloudflare-environments/) then the relevant `.dev.vars` file will be selected.
0 commit comments