Deployments
Source Maps
Production client source maps are disabled by default. Keep that default unless your error reporting workflow needs browser stack trace symbolication.
Hidden upload-only maps
Use hidden maps when a service such as Sentry should receive maps but visitors should not discover them through the client manifest or sourceMappingURL comments.
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
const projectRoot = dirname(fileURLToPath(import.meta.url));
mreactRouter({
projectRoot,
routesDir: "src/app",
clientSourceMaps: "hidden",
});mreact-router build --client-source-maps=hiddenHidden maps are written under .mreact/source-maps/client/. Upload those files during CI after mreact-router build, then deploy .mreact/client without the hidden map directory.
Sentry-style upload flow
- Choose a release identifier before the build, for example the Git commit SHA.
- Build with
clientSourceMaps: "hidden"ormreact-router build --client-source-maps=hidden. - Upload
.mreact/source-maps/client/**/*.mapto Sentry or another symbolication service using the same release identifier. - Deploy server output and
.mreact/client. - Do not copy
.mreact/source-mapsto the public static asset host.
Use the same release identifier in server logs and client error events so uploaded maps can be matched to minified stack traces.
Linked maps
Use clientSourceMaps: "linked" only for debugging environments where public .js.map files are acceptable. Linked maps are discoverable by visitors because JavaScript files include public source map references.