Skip to content

Rasengan.js

A Rasengan.js app deploys as static files when it renders in the browser, and as static files plus a Worker when it renders on the server. Hiraiship picks the right one from what rasengan build produces.

Detection

A project is Rasengan.js when rasengan is a dependency, or a rasengan.config.js or rasengan.config.ts file sits at its root. This is checked before Vite, since every Rasengan.js app also depends on Vite.

Defaults

SettingDefault
Install commandFrom your lockfile, see Frameworks
Build commandnpx rasengan build
Output directorydist/client

Client-side or server-rendered

After the build, Hiraiship looks at the output, in this order:

Output foundDeployed as
static/Static files from static/
dist/client and dist/serverServer-rendered: static files from dist/client, plus a Worker that renders pages
dist/client onlyStatic files from dist/client
dist/Static files from dist/

So ssr: true in rasengan.config.js gives you a server-rendered deployment, and ssr: false a static one, with nothing else to set.

Server-rendered apps

  • Requests for a file in dist/client (scripts, styles, images) are served directly and never run your server code.
  • Every other request runs the Worker, which renders the page. Deep links work.
  • API routes, if the app defines any, run in the same Worker.
  • Server code runs on Cloudflare Workers, not Node.js; see How requests reach your app. Environment variables reach the Worker.

Client-rendered apps

A client-rendered app is a single-page app: unknown paths serve its index.html, so deep links work. See Static sites for the exact rule.