loadConfig() — astro Function Reference
Architecture documentation for the loadConfig() function in config.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 389cc9ce_16f8_1d39_88ac_521d7093028a["loadConfig()"] b7dad900_b555_952f_158e_89aff4cc3f3d["config.ts"] 389cc9ce_16f8_1d39_88ac_521d7093028a -->|defined in| b7dad900_b555_952f_158e_89aff4cc3f3d 0d1ab03e_04f2_35e7_7e2d_93764ee4f484["resolveConfig()"] 0d1ab03e_04f2_35e7_7e2d_93764ee4f484 -->|calls| 389cc9ce_16f8_1d39_88ac_521d7093028a 59894d9c_2e9c_c54a_8fe0_95c5e156b046["resolveConfigPath()"] 389cc9ce_16f8_1d39_88ac_521d7093028a -->|calls| 59894d9c_2e9c_c54a_8fe0_95c5e156b046 style 389cc9ce_16f8_1d39_88ac_521d7093028a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/core/config/config.ts lines 74–101
async function loadConfig(
root: string,
configFile?: string | false,
fsMod = fs,
): Promise<Record<string, any>> {
if (configFile === false) return {};
const configPath = await resolveConfigPath({
root,
configFile,
fs: fsMod,
});
if (!configPath) return {};
// Create a vite server to load the config
try {
return await loadConfigWithVite({
root,
configPath,
fs: fsMod,
});
} catch (e) {
const configPathText = configFile ? colors.bold(configFile) : 'your Astro config';
// Config errors should bypass log level as it breaks startup
console.error(`${colors.bold(colors.red('[astro]'))} Unable to load ${configPathText}\n`);
throw e;
}
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does loadConfig() do?
loadConfig() is a function in the astro codebase, defined in packages/astro/src/core/config/config.ts.
Where is loadConfig() defined?
loadConfig() is defined in packages/astro/src/core/config/config.ts at line 74.
What does loadConfig() call?
loadConfig() calls 1 function(s): resolveConfigPath.
What calls loadConfig()?
loadConfig() is called by 1 function(s): resolveConfig.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free