Once your site has content, run a production build and publish the generated output. A Rocket build can produce two kinds of output:
dist/render: 'server'Static-only sites can deploy anywhere that serves files. Sites with Server-rendered JavaScript Pages need a production adapter so request-time routes have somewhere to run.
Run:
npx rocket build
Rocket bundles pages, images, styles, and browser modules into dist/. If the project has a
configured adapter and at least one server-rendered route, the adapter may also write hosting
specific output.
If your package.json has a build script, use that instead:
npm run build
For a site with no render: 'server' Pages:
dist/ folder into the upload area.Netlify serves the generated files as a static site.
When a Page opts into request-time rendering, configure the Netlify adapter in rocket-config.js:
import { netlify } from '@rocket/js/adapters/netlify.js';
export default {
includeGlobs: ['docs/**/*.rocket.{md,js}'],
adapter: netlify(),
};
Then mark request-time Pages with render: 'server':
export const config = {
path: '/api/time',
render: 'server',
};
After npx rocket build, Rocket keeps static Pages in dist/ and generates a Netlify Function in
.netlify/v1/functions/rocket-ssr.mjs for server-rendered routes.
Deploy this kind of site through Netlify Git integration or Netlify CLI so both dist/ and the
generated function are included. Uploading only dist/ publishes the static Pages but cannot serve
the server-rendered routes.
See Netlify Adapter for the full adapter reference and verification checklist.
npm run build or npx rocket build locally.dist/.render: 'server' Pages, confirm .netlify/v1/functions/rocket-ssr.mjs exists.