Skip to content

Commit

Permalink
feat!: use loadNuxtConfig
Browse files Browse the repository at this point in the history
requires nuxt >= 2.12.0. closes #87
  • Loading branch information
pi0 committed Mar 6, 2021
1 parent 340e8e4 commit 111ec67
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nuxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ export async function loadFixture () {

options.rootDir = resolve(options.testDir, options.fixture)

const loadedConfig = await import(resolve(options.rootDir, options.configFile))
.then(m => /* istanbul ignore next */ m.default || m)

options.config = defu(options.config, loadedConfig)
const { loadNuxtConfig } = await loadNuxtPackage()
options.config = await loadNuxtConfig({
rootDir: options.rootDir,
configFile: options.configFile,
configOverrides: options.config
})

if (!options.config.rootDir) {
options.config.rootDir = options.rootDir
Expand Down

0 comments on commit 111ec67

Please sign in to comment.