All files / packages/design-system-2-site/src/lib dev-tools.ts

100% Statements 1/1
100% Branches 2/2
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                              4x    
/**
 * Dev-only tooling flags.
 *
 * The Style Preview (`/style-preview`) is an internal reference that renders
 * every component and design token in one place. It's on under `next dev` and
 * left out of the production static export (`scripts/strip-style-preview.mjs`
 * deletes its not-found pages so the host returns a real 404).
 *
 * To include it in a production build (e.g. a preview deploy):
 *
 *   NEXT_PUBLIC_STYLE_PREVIEW=true yarn build
 *
 * `NODE_ENV` and `NEXT_PUBLIC_*` are inlined at build time, so the flag works in
 * server components (route gating) and client components (sidebar link).
 */
export const STYLE_PREVIEW_ENABLED =
  process.env.NODE_ENV !== 'production' || process.env.NEXT_PUBLIC_STYLE_PREVIEW === 'true';