Deploy
Standalone Worker
For projects created with npm create export:
bash
npm run exportThis runs two steps:
generate-export-types-- readspackage.json, parses your source with oxc-parser, generates type definitions, minifies the client, produces a unique cache-busting UUID, and auto-generateswrangler.tomlwrangler deploy-- deploys your Worker to Cloudflare
Workers Sites (Vite + export)
For Vite projects with exportc:
bash
npm run exportThis deploys your entire app to Workers Sites:
vite build-- builds your frontend appwrangler deploy-- deploys static assets + server exports together
Your Vite app's dist/ folder becomes the static assets, and your export/ functions are the Worker. Everything runs on Cloudflare's edge.
The production URL is auto-detected from export/package.json name. Your app is live at https://{name}.workers.dev.
Generated files
The build process generates several files in your project root:
| File | Purpose |
|---|---|
wrangler.toml | Auto-generated Cloudflare configuration |
.export-types.js | Type definitions and minified client core |
.export-module-map.js | Module routing map |
.export-shared.js | Shared state proxies for Workers RPC |
These files are regenerated on each build. You can add them to .gitignore:
gitignore
wrangler.toml
.export-*.jsEnvironment setup
If deploying from a headless server (CI, VPS), set your Cloudflare API token:
bash
export CLOUDFLARE_API_TOKEN=your-token-here
npm run exportCreate a token at Cloudflare Dashboard > API Tokens using the Edit Cloudflare Workers template.
Requirements
- Node.js 18+
- Cloudflare Workers account (free tier works)
- Wrangler 4+