feat(decnet_web/theme-lab): scaffold dev-gated /theme-lab route

Adds VITE_DECNET_DEVELOPER build-time gate: when unset, the
isDeveloperMode() helper collapses to a constant false and Vite
tree-shakes both the lazy import and the conditional <Route> out
of the prod bundle.

ThemeLab is currently a header stub; subsequent tasks fill it
with the design-system primitive zoo plus a Dark/Light toggle
for live token tuning. Route is intentionally absent from
ROUTE_LABELS / sidebar — direct URL only.
This commit is contained in:
2026-05-09 03:18:34 -04:00
parent 65ddaaa681
commit 846a50dbbf
6 changed files with 112 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/* Dev-only feature gate.
*
* Reads VITE_DECNET_DEVELOPER at build time. Vite inlines the value
* at compile, so a prod build with the flag unset becomes a constant
* `false` and the route guard plus its lazy import are tree-shaken
* out of the bundle entirely.
*
* Set in .env.development: VITE_DECNET_DEVELOPER=1
*/
export function isDeveloperMode(): boolean {
return import.meta.env.VITE_DECNET_DEVELOPER === '1';
}