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:
12
decnet_web/src/lib/devGate.ts
Normal file
12
decnet_web/src/lib/devGate.ts
Normal 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';
|
||||
}
|
||||
Reference in New Issue
Block a user