feat(config): support nuxtrc in dist directory (#9280)

This commit is contained in:
Daniel Roe 2021-05-17 19:53:20 +01:00 committed by GitHub
parent 00aeff62e7
commit 186df335d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,10 +88,13 @@ export async function loadNuxtConfig ({
} }
// Load Combine configs // Load Combine configs
// Priority: configOverrides > nuxtConfig > .nuxtrc > .nuxtrc (global) // Priority: configOverrides > nuxtConfig > .nuxt/dist/nuxtrc > .nuxtrc > .nuxtrc (global)
const dev = configOverrides.dev ?? options.dev ?? configContext.dev
const buildDir = configOverrides.buildDir ?? options.buildDir ?? configContext.buildDir ?? '.nuxt'
options = defu( options = defu(
configOverrides, configOverrides,
options, options,
!dev ? rc.read({ name: 'nuxtrc', dir: path.resolve(buildDir, 'dist') }) : {},
rc.read({ name: '.nuxtrc', dir: options.rootDir }), rc.read({ name: '.nuxtrc', dir: options.rootDir }),
rc.readUser('.nuxtrc') rc.readUser('.nuxtrc')
) )