Node.js Adapter (@react-just/node)
Plugin Usage
ts
import node from "@react-just/node";
import react from "react-just/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react(), node()],
});CLI Usage
The Node.js adapter provides a CLI command to serve your React Just app.
bash
$ npx react-just-node [build] -p [port] [--no-static]bash
$ pnpm react-just-node [build] -p [port] [--no-static]bash
$ bun react-just-node [build] -p [port] [--no-static]Parameters
build(optional): Path to the build output folder. Defaults todist.-por--port(optional): Port to run the server on. Defaults to3000.--no-static(optional): Disables serving static files from thestaticdirectory.
Examples
Serve a custom build folder output on port 4000:
bash
$ npx react-just-node output -p 4000bash
$ pnpm react-just-node output -p 4000bash
$ bun react-just-node output -p 4000Run without serving static files:
bash
$ npx react-just-node --no-staticbash
$ pnpm react-just-node --no-staticbash
$ bun react-just-node --no-static