diff --git a/lib/nuxt.js b/lib/nuxt.js index 93ee1499cc..6a6fbed55c 100644 --- a/lib/nuxt.js +++ b/lib/nuxt.js @@ -11,9 +11,12 @@ import Server from './server' import Defaults from './defaults' export default class Nuxt extends Tapable { - constructor (options = {}) { + constructor (_options = {}) { super() + // Clone options to prevent unwanted side-effects + const options = Object.assign({}, _options) + // Normalize options if (options.loading === true) { delete options.loading diff --git a/test/with-config.test.js b/test/with-config.test.js index 07c299f245..41fb678f42 100644 --- a/test/with-config.test.js +++ b/test/with-config.test.js @@ -111,4 +111,5 @@ test.after('Should be able to start Nuxt with build done', async t => { config.rootDir = rootDir config.dev = false nuxt = new Nuxt(config) + await nuxt.init() })