-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add experimental prerenderWorker option
#11697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
01bfc24 to
bae5826
Compare
…nt variable is defined
bae5826 to
8033489
Compare
|
We have this working in withastro/astro#15077 This change works for us. |
Adds an experimental
prerenderWorkeroption for defining a dedicated Worker for pre-rendering.Example:
Internally, the plugin now sets an environment variable during the build that indicates to the preview server that the prerender Worker should be used as the entry. This means that the Vite preview server can be used during the build to send requests to the prerender Worker.
An example of usage is included in https://github.com/cloudflare/workers-sdk/blob/803348985820e61a7e11a554a5633a8cadbe3751/packages/vite-plugin-cloudflare/playground/prerendering/vite.config.ts.
A picture of a cute animal (not mandatory, but encouraged)