Skip to content

waygraph / resolveBaseUrl

Function: resolveBaseUrl() ​

resolveBaseUrl(projectDir): Promise<string | undefined>

Defined in: src/runtime/waygraph-config.ts:310

Single source of truth for a project's base URL. Was three independently drifted copies (src/cli/flags.ts, src/live/traverse/traverse.ts, src/live/auto/auto.ts), each checking a slightly different subset of sources in a different order - real duplication, not just stylistic, since one copy skipped config.waygraph.* nesting and another checked WAYGRAPH_BASE_URL first instead of last. Checked in this order:

  1. WAYGRAPH_BASE_URL - a real shell export, or one loaded from a .env file (see loadEnvFiles, called here so every caller gets native .env support for free, not just whichever command remembered to call it).
  2. A waygraph.config.* file's baseUrl.

Parameters ​

projectDir ​

string

Returns ​

Promise<string | undefined>

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed