Dusk
Build a full-stack ShadowJS app with file routes, loaders, server functions and a secure request handler, and learn what runs on the server and what in the browser.
Dusk adds file routes, server rendering and server functions to ShadowJS. Start a project, follow a request through the app, then choose the guide for the task you are working on.
Start with Routes are files.
Install#
A Dusk app needs the four ShadowJS packages, Vite 7 or 8 and TypeScript. Node 22.12 or newer.
npm install @shadow-js/core @shadow-js/web @shadow-js/router @shadow-js/dusk
npm install -D vite typescript @types/node
@shadow-js/vite (the compiler plugin) is a dependency of @shadow-js/dusk and dusk() includes it, so
you do not add shadow() to vite.config.ts yourself.
The tsconfig.json sets "jsx": "preserve", "jsxImportSource": "@shadow-js/web" and
"types": ["vite/client", "node"]. The package scripts are dusk dev (development), dusk build and dusk start
(the production server). The dusk command lists their flags, and Deploy
covers the output.