MCPcopy Create free account
hub / github.com/observablehq/framework / resolveDefaultConfig

Function resolveDefaultConfig

src/config.ts:200–205  ·  view source on GitHub ↗
(root?: string)

Source from the content-addressed store, hash-verified

198}
199
200async function resolveDefaultConfig(root?: string): Promise<string | undefined> {
201 const jsPath = resolveConfig("observablehq.config.js", root);
202 if (existsSync(jsPath)) return jsPath;
203 const tsPath = resolveConfig("observablehq.config.ts", root);
204 if (existsSync(tsPath)) return await import("tsx/esm"), tsPath; // lazy tsx
205}
206
207let cachedPages: {key: string; pages: Page[]} | null = null;
208

Callers 1

readConfigFunction · 0.85

Calls 2

resolveConfigFunction · 0.85
existsSyncFunction · 0.85

Tested by

no test coverage detected