Skip to content

Commit ddb1c6c

Browse files
committed
Tweaks
1 parent dc3d7d3 commit ddb1c6c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ It accepts an optional `PluginConfig` parameter.
3131
An optional path to your Worker config file.
3232
By default, a `wrangler.jsonc`, `wrangler.json`, or `wrangler.toml` file in the root of your application will be used as the Worker config.
3333

34+
For more information about the Worker configuration, see [Configuration](/workers/wrangler/configuration/).
35+
3436
- `viteEnvironment?: { name?: string }`
3537

3638
Optional Vite environment options.
3739
By default, the environment name is the Worker name with `-` characters replaced with `_`.
3840
Setting the name here will override this.
3941
A typical use case is setting `viteEnvironment: { name: "ssr" }` to apply the Worker to the SSR environment.
42+
4043
See [Vite Environments](/workers/vite-plugin/vite-environments/) for more information.
4144

4245
- `persistState?: boolean | { path: string }`
@@ -50,6 +53,7 @@ It accepts an optional `PluginConfig` parameter.
5053
An optional override for debugging your Workers.
5154
By default, the debugging inspector is enabled and listens on port `9229`.
5255
A custom port can be provided or, alternatively, setting this to `false` will disable the debugging inspector.
56+
5357
See [Debugging](/workers/vite-plugin/debugging/) for more information.
5458

5559
- `auxiliaryWorkers?: Array<AuxiliaryWorkerConfig>`
@@ -72,9 +76,12 @@ You can inspect the `dist` directory and then run `wrangler deploy -c dist/<auxi
7276

7377
A required path to your Worker config file.
7478

79+
For more information about the Worker configuration, see [Configuration](/workers/wrangler/configuration/).
80+
7581
- `viteEnvironment?: { name?: string }`
7682

7783
Optional Vite environment options.
7884
By default, the environment name is the Worker name with `-` characters replaced with `_`.
7985
Setting the name here will override this.
86+
8087
See [Vite Environments](/workers/vite-plugin/vite-environments/) for more information.

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Start by creating a React TypeScript project with Vite.
3535
args="cloudflare-vite-tutorial --template react-ts"
3636
/>
3737

38-
Open the `cloudflare-vite-tutorial` directory in your editor of choice.
38+
Next, open the `cloudflare-vite-tutorial` directory in your editor of choice.
3939

4040
#### Add the Cloudflare dependencies
4141

@@ -55,6 +55,10 @@ export default defineConfig({
5555
});
5656
```
5757

58+
The Cloudflare Vite plugin doesn't require any configuration by default and will look for a `wrangler.jsonc`, `wrangler.json` or `wrangler.toml` in the root of your application.
59+
60+
Refer to the [API reference](/workers/vite-plugin/api/) for configuration options.
61+
5862
#### Create your Worker config file
5963

6064
<WranglerConfig>
@@ -145,7 +149,7 @@ main = "./worker/index.ts"
145149

146150
</WranglerConfig>
147151

148-
Setting the `not_found_handling` to `single-page-application` means that navigation requests that do not match a static asset will always return the `index.html` file.
152+
The `main` field specifies the entry file for your Worker code.
149153

150154
#### Add your API Worker
151155

@@ -257,7 +261,7 @@ Run `npm run build` to build your application.
257261
If you inspect the `dist` directory, you will see that it contains two subdirectories:
258262

259263
- `client` - the client code that runs in the browser
260-
- `cloudflare-vite-tutorial` - the Worker code and the output `wrangler.json` Worker configuration
264+
- `cloudflare-vite-tutorial` - the Worker code alongside the output `wrangler.json` configuration file
261265

262266
#### Preview your application
263267

0 commit comments

Comments
 (0)