All files / src/lib static-export.ts

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

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                  111x             111x  
/**
 * True in the GitHub Pages build (NEXT_PUBLIC_STATIC_EXPORT=true), where the
 * API routes do not exist and fetchApi() serves /mock/*.json instead. Next
 * inlines NEXT_PUBLIC_* at build time, so this is a constant per bundle.
 *
 * Read once at module load. Code that a test flips with vi.stubEnv without
 * reloading the module (fetchApi, the EUDI QR page) reads the variable at
 * call time instead.
 */
export const IS_STATIC = process.env.NEXT_PUBLIC_STATIC_EXPORT === "true";
 
/**
 * The path the static export is served under, "" on the hub. Next adds it to
 * its own links and assets; a plain <img src> or fetch() of a file in public/
 * adds it itself.
 */
export const BASE_PATH = IS_STATIC ? "/MinimumViableHealthDataspacev2" : "";