PoC for running Vite's SSR support on emulated environments (e.g. Edge Runtime).
Powered by Vite Runtime API.
- Throwing errors when accessing global variables that exist in Node but don't in workers (e.g.
process
,global
) - Ability to use worker-only features that are not supported in Node (e.g. Cloudflare KV,
URLPattern
) - Performant HMR
$ pnpm i
$ pnpm -r build
$ cd examples/cloudflare-pages # or other directories in example
$ pnpm dev
- packages
- types: contains types for the common interface (
ViteRuntimeEnv
) - cloudflare-pages: a Vite plugin that exposes
ViteRuntimeEnv
for cloudflare workerd using the actual workerd - vercel-edge: a Vite plugin that exposes
ViteRuntimeEnv
for edge-runtime using@edge-runtime/vm
- example-framework: an example framework that uses
ViteRuntimeEnv
- types: contains types for the common interface (
- examples
- cloudflare-pages: an example using example-framework + cloudflare pages ViteRuntimeEnv plugin
- vercel-edge: an example using example-framework + vercel edge ViteRuntimeEnv plugin