From e0005dddeac26551e567e775fd10cecdda0f1091 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 15 Mar 2018 17:37:43 +0800 Subject: [PATCH] deprecate: remove options.dev in build.extend() --- lib/builder/webpack/client.config.js | 4 ---- lib/builder/webpack/server.config.js | 4 ---- test/deprecate.test.js | 8 -------- test/fixtures/deprecate/nuxt.config.js | 7 +------ 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/builder/webpack/client.config.js b/lib/builder/webpack/client.config.js index eb93137b0a..cd3ff13e43 100644 --- a/lib/builder/webpack/client.config.js +++ b/lib/builder/webpack/client.config.js @@ -137,10 +137,6 @@ module.exports = function webpackClientConfig() { if (typeof this.options.build.extend === 'function') { const isDev = this.options.dev const extendedConfig = this.options.build.extend.call(this, config, { - get dev() { - printWarn('dev has been deprecated in build.extend(), please use isDev') - return isDev - }, isDev, isClient: true }) diff --git a/lib/builder/webpack/server.config.js b/lib/builder/webpack/server.config.js index 064423742c..382b0cd76e 100644 --- a/lib/builder/webpack/server.config.js +++ b/lib/builder/webpack/server.config.js @@ -75,10 +75,6 @@ module.exports = function webpackServerConfig() { if (typeof this.options.build.extend === 'function') { const isDev = this.options.dev const extendedConfig = this.options.build.extend.call(this, config, { - get dev() { - printWarn('dev has been deprecated in build.extend(), please use isDev') - return isDev - }, isDev, isServer: true }) diff --git a/test/deprecate.test.js b/test/deprecate.test.js index 92187220a6..eff3bd4b29 100644 --- a/test/deprecate.test.js +++ b/test/deprecate.test.js @@ -27,14 +27,6 @@ test.serial('Init Nuxt.js', async t => { t.true(buildSpies.log.calledWithMatch('OPEN')) }) -test.serial('Deprecated: dev in build.extend()', async t => { - t.true( - buildSpies.warn.calledWithMatch( - 'dev has been deprecated in build.extend(), please use isDev' - ) - ) -}) - test.serial('Deprecated: nuxt.plugin()', async t => { t.true(nuxt.__builder_plugin) }) diff --git a/test/fixtures/deprecate/nuxt.config.js b/test/fixtures/deprecate/nuxt.config.js index f53f162aea..6415102f2f 100644 --- a/test/fixtures/deprecate/nuxt.config.js +++ b/test/fixtures/deprecate/nuxt.config.js @@ -1,11 +1,6 @@ module.exports = { modules: ['~/modules/deprecated-apis'], build: { - stats: false, - extend(config, options) { - if (options.dev) { - // Please use isDev instead of dev - } - } + stats: false } }