mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +00:00
22 lines
539 B
JavaScript
22 lines
539 B
JavaScript
|
import path from 'path'
|
||
|
import fs from 'fs'
|
||
|
import _getPort from 'get-port'
|
||
|
|
||
|
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 Object.assign({}, config, overrides)
|
||
|
}
|
||
|
|
||
|
export function getPort() {
|
||
|
return _getPort()
|
||
|
}
|