Skip to content

Commit

Permalink
fix(config): remove unsupported nullish coalescing
Browse files Browse the repository at this point in the history
* issue introduced in #9280

closes #9321
  • Loading branch information
danielroe committed May 21, 2021
1 parent c56d484 commit 24c79a1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/config/src/load.js
Expand Up @@ -8,6 +8,14 @@ import destr from 'destr'
import * as rc from 'rc9'
import { defaultNuxtConfigFile } from './config'

function coalesce(...values) {
const value = values.shift()
if (value !== null && value !== undefined) {
return value
}
return coalesce(...values)
}

export async function loadNuxtConfig ({
rootDir = '.',
envConfig = {},
Expand Down Expand Up @@ -89,8 +97,8 @@ export async function loadNuxtConfig ({

// Load Combine configs
// 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'
const dev = coalesce(configOverrides.dev, options.dev, configContext.dev)
const buildDir = coalesce(configOverrides.buildDir, options.buildDir, configContext.buildDir, '.nuxt')
options = defu(
configOverrides,
options,
Expand Down

0 comments on commit 24c79a1

Please sign in to comment.