Skip to content

Frameworks

HostEdge deploys a folder of static files, plus optional server code that runs as a Worker on a global edge network. Any framework that can build to static files works, and Next.js, Astro, SvelteKit, Nuxt and React Router can render on the server too. The presets below only fill in the commands and the output folder; you can change them at any time in Project › Settings.

HostEdge looks at your package.json (and your lockfile) when you upload or import a project and picks the most specific match, so a Nuxt project is detected as Nuxt rather than Vite.

Static sites#

FrameworkDetected whenBuild commandOutput
Static HTMLAn index.html, no build scriptnonethe folder itself
Astroastronpm run builddist
Gatsbygatsbynpm run buildpublic
Eleventy@11ty/eleventynpx @11ty/eleventy_site

Apps#

FrameworkDetected whenBuild commandOutput
Next.js (static export)nextnpm run buildout
Nuxt (static)nuxtnpx nuxi generate.output/public
SvelteKit (static)@sveltejs/kitnpm run buildbuild
React Router (SPA mode)@react-router/devnpm run buildbuild/client
Vite + React, Vue or Sveltevite and the UI librarynpm run builddist
Vitevite (Solid, Preact, Lit …)npm run builddist
Angular@angular/corenpm run builddist/<name>/browser
Create React Appreact-scriptsnpm run buildbuild

Single-page apps (Vite, Angular, Create React App, React Router) are served with SPA fallback: unknown paths return index.html so client-side routing works. Everything else returns your 404.html if you have one.

Documentation#

FrameworkDetected whenBuild commandOutput
Docusaurus@docusaurus/corenpm run buildbuild
VitePressvitepressthe script that runs vitepress build<folder>/.vitepress/dist

Server-rendered apps#

FrameworkDetected whenBuild commandOutput
Next.js (full)nextnpx opennextjs-cloudflare build.open-next/assets
Astro (server)astro and @astrojs/cloudflarenpm run builddist/client
SvelteKit (server)@sveltejs/kit and adapter-cloudflarenpm run build.svelte-kit/cloudflare
Nuxt (server)nuxt and nitro-cloudflare-dev or wranglernpx nuxi build --preset=cloudflare_module.output/public
React Router (server)@react-router/dev and @cloudflare/vite-pluginnpm run buildbuild/client

Each framework's edge adapter writes the server code; after your build command, HostEdge bundles it into a Worker (with wrangler deploy --dry-run, using your wrangler.jsonc if the project has one) and serves your static files next to it. Pages, API routes, server actions, middleware, loaders and form actions all work. Prerendered pages are served as files without waking the server.

Things to know:

  • Next.js works without setup. If the project has no @opennextjs/cloudflare, open-next.config.ts or wrangler.jsonc, the build adds them (your own files always win). For a static export (output: "export"), pick Next.js (static export) instead.
  • Next.js caching (ISR) is on automatically. The first deploy creates a page cache and a tag database for the project (shown in Storage, free and not counted against your plan). Pages prerendered at build time are in the cache before the deploy goes live. Pages with revalidate are served instantly and refreshed in the background once stale; revalidatePath and revalidateTag work across all visitors. If you bring your own open-next.config.ts, use the object-storage incremental cache and the database tag cache to get the same behaviour.
  • Node.js APIs are available (nodejs_compat): Buffer, AsyncLocalStorage, crypto and most of node:*. Native modules and child processes are not.
  • Bindings from your own wrangler config are not used. Databases, key-value stores and file storage you create in Project › Storage are bound by name, and environment variables are available as usual.
  • Size: the server bundle must stay under 10 MB gzipped. The build log shows how many modules were bundled.

Workers#

FrameworkDetected whenBuild commandOutput
Honohononpm run builddist, with dist/_worker.js

A _worker.js file at the top of the output folder becomes the Worker. For several modules, write a _worker.js/ folder with an index.js entry (the usual Pages-style layout); .js, .mjs, .cjs, .wasm, .txt, .html, .sql and .bin files in it are uploaded as modules and never served as files. Static files are served alongside through the ASSETS binding. Workers run with the per-plan CPU and subrequest limits listed on Pricing, and outbound requests to private networks and cloud metadata endpoints are blocked.

Anything else#

Pick Other and set the build command and output folder yourself. If your tool writes HTML, CSS and JavaScript to a folder, HostEdge can host it.

Package managers#

HostEdge installs with the package manager your lockfile names: npm ci for package-lock.json, pnpm install --frozen-lockfile for pnpm-lock.yaml, and yarn install --frozen-lockfile (or --immutable for Yarn 2+) for yarn.lock. Without a lockfile it follows the packageManager field in package.json, then falls back to npm install. Builds run on Node.js 22. Bun projects build with npm.

Root directory#

For monorepos, set the root directory to the folder that contains the app's package.json. Commands run there and the output folder is relative to it. A lockfile at the repository root is still used.

View this page as MarkdownAll docs as one file