Reference
CLI
The mreact-router CLI is the operational entrypoint for local development, production builds, serving Node output, and packaging adapter artifacts. Use command-level help when you need the exact option list for the installed version.
When to use this page
Use this page when you need to choose the right CLI command, map an npm script to a build target, enable request logging, or create deployment artifacts from an existing .mreact build.
Commands
mreact-router devstarts the Vite-backed development server. It is the default when no command is provided.mreact-router build --target=nodebuilds Node server output and client assets into.mreact.mreact-router build --target=cloudflarebuilds Cloudflare-compatible output.mreact-router build --target=aws-lambdabuilds AWS Lambda-compatible output.mreact-router build --target=allwrites every supported target in one build.mreact-router startserves the built Node target.mreact-router package aws-lambdacreates a minimal AWS Lambda package directory from existing build output.mreact-router package cloudflare-pagescreates a Cloudflare Pages advanced-mode artifact with_worker.js.
mreact-router dev --host 0.0.0.0 --port 3001 --log requests
mreact-router build --target=node --client-source-maps=hidden
mreact-router build --target=aws-lambda
mreact-router package aws-lambda --from .mreact --out .lambdaOptions to know first
--target=node|cloudflare|aws-lambda|allcontrols which production artifact is built.--client-source-maps=none|hiddencontrols production browser source maps. Usehiddenwhen you upload maps to Sentry or another error pipeline without publishing source map comments to browsers.mreact-router devreads--hostand--port.mreact-router startreads--host,--host-policy, and--allowed-hosts. SetPORTwhen you need a non-default start-server port.--log requestsenables compact request logs.MREACT_ROUTER_LOG=requestsenables the same mode from the environment.--from,--out,--handler, and--skip-runtime-dependency-checkare packaging options used after a build.
Package scripts
Keep application scripts explicit about the target they produce. That makes CI logs and deployment jobs easier to read.
{
"scripts": {
"dev": "mreact-router dev",
"build": "mreact-router build --target=node",
"build:cloudflare": "mreact-router build --target=cloudflare",
"build:lambda": "mreact-router build --target=aws-lambda",
"start": "mreact-router start"
}
}Related pages
API reference: buildApp(), startServer(), packageAwsLambdaArtifact(), and packageCloudflarePagesArtifact().