Skip to content

Commit 761cfa8

Browse files
jamesopstadRebeccaTamachiro
authored andcommitted
Add headers and redirects section to Vite plugin docs (#21504)
* Add note about auxiliary Workers and React Router * Add headers and redirects section to Static Assets
1 parent b43a005 commit 761cfa8

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ It accepts an optional `PluginConfig` parameter.
6363
All requests are routed through your entry Worker.
6464
During the build, each Worker is output to a separate subdirectory of `dist`.
6565

66-
:::note
67-
When running `wrangler deploy`, only your main (entry) Worker will be deployed.
68-
If using multiple Workers, each auxiliary Worker must be deployed individually.
69-
You can inspect the `dist` directory and then run `wrangler deploy -c dist/<auxiliary-worker>/wrangler.json` for each.
70-
:::
66+
:::note
67+
Auxiliary Workers are not currently supported when using [React Router](https://reactrouter.com/) as a framework.
68+
:::
69+
70+
:::note
71+
When running `wrangler deploy`, only your main (entry) Worker will be deployed.
72+
If using multiple Workers, each auxiliary Worker must be deployed individually.
73+
You can inspect the `dist` directory and then run `wrangler deploy -c dist/<auxiliary-worker>/wrangler.json` for each.
74+
:::
7175

7276
## `interface AuxiliaryWorkerConfig`
7377

src/content/docs/workers/vite-plugin/reference/static-assets.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ assets = { not_found_handling = "single-page-application" }
3232

3333
</WranglerConfig>
3434

35-
{/* Add docs for _headers and _redirects */}
35+
## Headers and redirects
36+
37+
Custom [headers](/workers/static-assets/headers/) and [redirects](/workers/static-assets/redirects/) are supported at build, preview and deploy time by adding `_headers` and `_redirects` files to your [`public` directory](https://vite.dev/guide/assets#the-public-directory).
38+
The paths in these files should reflect the structure of your client build output.
39+
For example, generated assets are typically located in an [assets subdirectory](https://vite.dev/config/build-options#build-assetsdir).
40+
41+
<br />
3642

3743
:::note
3844
The Cloudflare Vite plugin does not support [run_worker_first](/workers/static-assets/binding/#run_worker_first).

0 commit comments

Comments
 (0)