deprecate: remove options.dev in build.extend()

This commit is contained in:
Clark Du 2018-03-15 17:37:43 +08:00
parent 90d9283e70
commit e0005dddea
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
4 changed files with 1 additions and 22 deletions

View File

@ -137,10 +137,6 @@ module.exports = function webpackClientConfig() {
if (typeof this.options.build.extend === 'function') { if (typeof this.options.build.extend === 'function') {
const isDev = this.options.dev const isDev = this.options.dev
const extendedConfig = this.options.build.extend.call(this, config, { 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, isDev,
isClient: true isClient: true
}) })

View File

@ -75,10 +75,6 @@ module.exports = function webpackServerConfig() {
if (typeof this.options.build.extend === 'function') { if (typeof this.options.build.extend === 'function') {
const isDev = this.options.dev const isDev = this.options.dev
const extendedConfig = this.options.build.extend.call(this, config, { 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, isDev,
isServer: true isServer: true
}) })

View File

@ -27,14 +27,6 @@ test.serial('Init Nuxt.js', async t => {
t.true(buildSpies.log.calledWithMatch('OPEN')) 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 => { test.serial('Deprecated: nuxt.plugin()', async t => {
t.true(nuxt.__builder_plugin) t.true(nuxt.__builder_plugin)
}) })

View File

@ -1,11 +1,6 @@
module.exports = { module.exports = {
modules: ['~/modules/deprecated-apis'], modules: ['~/modules/deprecated-apis'],
build: { build: {
stats: false, stats: false
extend(config, options) {
if (options.dev) {
// Please use isDev instead of dev
}
}
} }
} }