mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +00:00
17b01d0aa8
This reverts commit ca1242d5ec
.
23 lines
576 B
JavaScript
23 lines
576 B
JavaScript
import path from 'path'
|
|
import fs from 'fs'
|
|
import _getPort from 'get-port'
|
|
import { defaultsDeep } from 'lodash'
|
|
|
|
import { requireModule } from '../../lib/common/module'
|
|
|
|
export function loadFixture(fixture, overrides) {
|
|
const rootDir = path.resolve(__dirname, '../fixtures/' + fixture)
|
|
const configFile = path.resolve(rootDir, 'nuxt.config.js')
|
|
|
|
const config = fs.existsSync(configFile) ? requireModule(configFile) : {}
|
|
|
|
config.rootDir = rootDir
|
|
config.dev = false
|
|
|
|
return defaultsDeep({}, overrides, config)
|
|
}
|
|
|
|
export function getPort() {
|
|
return _getPort()
|
|
}
|