diff --git a/packages/config/src/load.js b/packages/config/src/load.js index 72f832e2c2..94337a1af4 100644 --- a/packages/config/src/load.js +++ b/packages/config/src/load.js @@ -88,10 +88,13 @@ export async function loadNuxtConfig ({ } // 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( configOverrides, options, + !dev ? rc.read({ name: 'nuxtrc', dir: path.resolve(buildDir, 'dist') }) : {}, rc.read({ name: '.nuxtrc', dir: options.rootDir }), rc.readUser('.nuxtrc') )