Node.js
View as MarkdownThe Node.js adapter builds your application into a standalone Node.js server. This is suitable for deploying to VPS providers (DigitalOcean, Linode), PaaS (Heroku, Railway, Render), or custom infrastructure.
Usage
The Node adapter ships inside @neutron-build/core and is selected at build time via the CLI's --preset flag — no separate install needed. For a long-running Node server, use the docker preset (which produces a Node server.mjs you can run directly without containerizing).
-
Build with the Docker preset (produces a standalone Node server):
npx @neutron-build/cli build --preset docker -
Run the generated server:
node dist/server.mjs
neutron-ts preview vs. the production artifact
npx neutron-ts preview starts a local preview server that runs SSR through the
dev toolchain (Vite + your src/ files). It is convenient for a quick local
check, but it is not the artifact you deploy:
- Preview needs
src/and your dev dependencies present, and pulls Vite at runtime. - The deployed artifact is the preset-generated entry (e.g.
dist/server.mjsfrom--preset docker), which bundles everything and ships no Vite — it runs fromdist/alone.
To validate what actually deploys, build with a preset and run the generated
server (the two commands above) rather than relying on preview.