Repository navigation
fix: disable expo router sitemap in production builds - #164
Merged
Merged
Conversation
💯 Test Coverage
😎 Tests Results
👀 Tests Details • (56%)
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change that disables the sitemap in production while preserving it for non-production debugging.
No open issues 🎉
What changed in this PR
Overall Review: ai:clean
Disables Expo Router’s sitemap route in production while preserving it as a debugging aid in non-production environments. No actionable findings remain.
Changes:
- Sets the sitemap plugin option based on
Env.APP_ENV. - Adds configuration tests for production, development, QA, and staging.
- Documents sitemap availability and how projects can override the default.
| File | Description |
|---|---|
docs/src/content/docs/guides/navigation.mdx |
Documents environment-specific sitemap behavior and customization. |
app.config.ts |
Disables the sitemap for production. |
__tests__/app-config.test.ts |
Checks sitemap configuration across all four environments. |
Review effort: Balanced
asdolo
requested changes
Nov 3, 2026
asdolo
approved these changes
Nov 3, 2026
Collaborator
There was a problem hiding this comment.
@devs-rootstrap I left a few comments on this PR, please take a look.
|
✅ Good news! We ran Expo Doctor for this PR and everything looks good, Great job! |
amaury901130
approved these changes
Nov 4, 2026
fernandatoledo
enabled auto-merge
November 16, 2026 17:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira board reference:
What does this do?
expo-routerplugin inapp.config.tswithsitemap: Env.APP_ENV !== 'production', so the auto-generated/_sitemaproute is no longer included in production builds. Development, QA and staging builds keep it.__tests__/app-config.test.ts, which loadsapp.config.tsfor eachAPP_ENVand asserts theexpo-routerplugin options (sitemap: falsefor production,truefor the rest).docs/src/content/docs/guides/navigation.mdx), including how to change it.Why did you do this?
Expo Router injects a
/_sitemaproute listing every route in the app. The Expo docs don't say whether it is excluded from release builds, so I checked the source: inexpo-router6.0.23 (the version we use),getRoutesCore.jsadds the sitemap route wheneveroptions.sitemap !== false, with no check for dev vs. release. The option comes from the config plugin'ssitemapsetting, which is written toextra.routerand read at runtime. So today the route ships in production builds and exposes the full route list.It's still a useful debugging aid, so it stays enabled in every non-production environment.
Assumptions:
productionshould drop the sitemap;development,qaandstagingkeep it.Env.APP_ENVfollows the same pattern already used for the app icon badge inapp.config.ts.Who/what does this impact?
<scheme>://_sitemap(and/_sitemapon web) now lands on the not-found screen instead of the route list.app.config.ts.Layer 2: Risk Classification
Author applies a risk label when opening the PR. When in doubt, escalate.
risk:lowrisk:mediumrisk:highSetup
risk:low,risk:medium,risk:highlabels in the repoHow did you test this?
Verification
pnpm lintpnpm type-checkpnpm lint:translationspnpm testAPP_ENV=production npx expo config --type public --jsonextra.routeris{ "sitemap": false }, plugin entry["expo-router", { "sitemap": false }]APP_ENV=development npx expo config --type public --jsonextra.routeris{ "sitemap": true }APP_ENV=qa/APP_ENV=staging(same command)extra.routeris{ "sitemap": true }Not yet verified on a device or emulator.
How to test locally
pnpm start:development, thenpnpm iosorpnpm android) and open<scheme>://_sitemap(e.g.npx uri-scheme open "RootstrapApp://_sitemap" --ios). The sitemap screen should list the app routes.APP_ENV=production npx expo config --type public --jsonand check thatextra.router.sitemapisfalse.pnpm start:production), open the same link: it should land on the not-found screen.Notes:
This only changes the default in the template. Projects that want the sitemap in production can set the
sitemapoption of theexpo-routerplugin totrueinapp.config.ts.Screenshots / Previews
N/A (no UI changes).