Skip to content

Commit 19a8a91

Browse files
authored
Apply a few suggestions from code review
1 parent ddb1c6c commit 19a8a91

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/content/docs/workers/vite-plugin/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Your Worker code runs inside [workerd](https://github.com/cloudflare/workerd), m
1212

1313
### Features
1414

15-
- Uses the Vite [Environment API](https://vite.dev/guide/api-environment) to integrate Vite with the Workers runtime
16-
- Provides direct access to Workers runtime APIs and bindings
15+
- Uses the Vite [Environment API](https://vite.dev/guide/api-environment) to integrate Vite with the [Workers runtime](/workers/runtime-apis/)
16+
- Provides direct access to [Workers runtime APIs](/workers/runtime-apis/) and [bindings](/workers/runtime-apis/bindings/)
1717
- Builds your front-end assets for deployment to Cloudflare, enabling you to build static sites, SPAs, and full-stack applications
1818
- Official support for [React Router v7](https://reactrouter.com/) with server-side rendering
1919
- Leverages Vite's hot module replacement for consistently fast updates

src/content/docs/workers/vite-plugin/migrating-from-wrangler-dev.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ sidebar:
77
description: Migrating from wrangler dev to the Vite plugin
88
---
99

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/).
1111
There are a few key differences to highlight:
1212

1313
### Input and output Worker config files
1414

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.
1616
This output file is a snapshot of your configuration at the time of the build and is modified to reference your build artifacts.
1717
It is the configuration that is used for preview and deployment.
1818
Once you have run `vite build`, running `wrangler deploy` or `vite preview` will automatically locate this output configuration file.
1919

2020
### Cloudflare Environments
2121

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.
2323
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.
2524

2625
### Redundant fields in the Wrangler config file
2726

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.
2928
If these options are provided, then warnings will be printed to the console with suggestions for how to proceed.
3029
Examples where the Vite configuration should be used instead include `alias` and `define`.
3130
See [Vite Environments](/workers/vite-plugin/vite-environments/) for more information about configuring your Worker environments in Vite.

src/content/docs/workers/vite-plugin/secrets.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ description: Using secrets with the Vite plugin
99

1010
import { PackageManagers, WranglerConfig } from "~/components";
1111

12-
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.
1313
For deployed Workers, they are set via the dashboard or Wrangler CLI.
14-
See [Secrets](/workers/configuration/secrets/) for more information.
1514

1615
In local development, secrets can be provided to your Worker by using a [`.dev.vars`](/workers/configuration/secrets/#local-development-with-secrets) file.
1716
If you are using [Cloudflare Environments](/workers/vite-plugin/cloudflare-environments/) then the relevant `.dev.vars` file will be selected.

0 commit comments

Comments
 (0)