mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +00:00
clone options to prevent unwanted side-effects
fixes with-config test that runs nuxt twice with same nuxt.config.js file
This commit is contained in:
parent
76c3b358cc
commit
b61694ca21
@ -11,9 +11,12 @@ import Server from './server'
|
|||||||
import Defaults from './defaults'
|
import Defaults from './defaults'
|
||||||
|
|
||||||
export default class Nuxt extends Tapable {
|
export default class Nuxt extends Tapable {
|
||||||
constructor (options = {}) {
|
constructor (_options = {}) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
|
// Clone options to prevent unwanted side-effects
|
||||||
|
const options = Object.assign({}, _options)
|
||||||
|
|
||||||
// Normalize options
|
// Normalize options
|
||||||
if (options.loading === true) {
|
if (options.loading === true) {
|
||||||
delete options.loading
|
delete options.loading
|
||||||
|
@ -111,4 +111,5 @@ test.after('Should be able to start Nuxt with build done', async t => {
|
|||||||
config.rootDir = rootDir
|
config.rootDir = rootDir
|
||||||
config.dev = false
|
config.dev = false
|
||||||
nuxt = new Nuxt(config)
|
nuxt = new Nuxt(config)
|
||||||
|
await nuxt.init()
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user