mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
deprecate: remove options.dev in build.extend()
This commit is contained in:
parent
90d9283e70
commit
e0005dddea
@ -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
|
||||||
})
|
})
|
||||||
|
@ -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
|
||||||
})
|
})
|
||||||
|
@ -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)
|
||||||
})
|
})
|
||||||
|
7
test/fixtures/deprecate/nuxt.config.js
vendored
7
test/fixtures/deprecate/nuxt.config.js
vendored
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user