Deployment
Details, the Docker example and the proxy settings (allowedHosts, trustProxy) are in Deploy and Security.
| Next.js | Dusk |
|---|---|
next build |
dusk build: dist/client (assets), dist/server/entry.js (exports handler), dist/dusk-manifest.json |
next start |
dusk start with the Node adapter, or a file you own that calls serve(handler, { static: { dir } }) from @shadow-js/dusk/node. Graceful shutdown on SIGTERM, gzip and brotli, range requests, ETags |
output: "standalone", Docker |
Copy dist and the production node_modules into a Node 22 image, then run node dist/node/server.mjs; see Deploy |
output: "export" |
export const prerender = true on every route, or prerender() from @shadow-js/dusk/static; the output is a folder of HTML plus 200.html as the single-page-app fallback |
| Vercel, Netlify, Cloudflare | vercel(), netlify() and cloudflare() from @shadow-js/dusk/vercel, @shadow-js/dusk/netlify and @shadow-js/dusk/cloudflare; bun(), deno(), tarout() and staticSite() exist too. See Platforms |
middleware.ts on the edge |
The middleware array of src/entry-server.ts runs in whichever runtime the adapter emits; an edge adapter fails the build when the bundle imports a node: module |
| Health checks | GET /_dusk/health answers 200 |
| Image optimization, ISR, on-demand revalidation | The images() optimizer at /_dusk/image; ISR with a route's revalidate; revalidatePath and revalidateTag from @shadow-js/dusk/server. See Caching pages (ISR) |
next/image, next/script |
<Image> and <Script> from @shadow-js/dusk/components, and the helpers imageProps, scriptTag and loadScript; see Components |
after(), draft mode, instrumentation.ts, WebSockets |
after from @shadow-js/dusk/server, draftMode(), src/instrumentation.ts, and streams() for SSE and WebSocket routes |
Details, the Docker example and the proxy settings (allowedHosts, trustProxy) are in Deploy
and Security.