mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(kit): add default config layer without nuxt.config
file (#7358)
This commit is contained in:
parent
d81a742311
commit
a418895595
@ -34,6 +34,17 @@ export async function loadNuxtConfig (opts: LoadNuxtConfigOptions): Promise<Nuxt
|
||||
// Filter layers
|
||||
nuxtConfig._layers = layers.filter(layer => layer.configFile && !layer.configFile.endsWith('.nuxtrc'))
|
||||
|
||||
// Ensure at least one layer remains (without nuxt.config)
|
||||
if (!nuxtConfig._layers.length) {
|
||||
nuxtConfig._layers.push({
|
||||
cwd,
|
||||
config: {
|
||||
rootDir: cwd,
|
||||
srcDir: cwd
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Resolve and apply defaults
|
||||
return applyDefaults(NuxtConfigSchema, nuxtConfig) as NuxtOptions
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user