fix: wrap loadConfig in try/catch
This commit is contained in:
parent
9388fd0cdf
commit
4c21b35ea6
1 changed files with 15 additions and 12 deletions
|
@ -132,7 +132,10 @@ export async function loadConfig(options: LoadConfigOptions): Promise<AstroConfi
|
|||
}
|
||||
// Automatically load config file using Proload
|
||||
// If `userConfigPath` is `undefined`, Proload will search for `astro.config.[cm]?[jt]s`
|
||||
const config = await load('astro', { mustExist: false, cwd: root, filePath: userConfigPath });
|
||||
let config;
|
||||
try {
|
||||
config = await load('astro', { mustExist: false, cwd: root, filePath: userConfigPath });
|
||||
} catch (e) {}
|
||||
if (config) {
|
||||
userConfig = config.value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue