From 2dd5e09efd6005fc0b084da28c14b6cdf5d8aba3 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Tue, 19 Nov 2019 21:35:08 +0800 Subject: [PATCH] fix($core): isProd is undefined in ready hook --- packages/@vuepress/core/lib/index.js | 2 ++ packages/@vuepress/core/lib/node/App.js | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@vuepress/core/lib/index.js b/packages/@vuepress/core/lib/index.js index 85afa96123..31d0ad8576 100644 --- a/packages/@vuepress/core/lib/index.js +++ b/packages/@vuepress/core/lib/index.js @@ -11,12 +11,14 @@ function createApp (options) { async function dev (options) { const app = createApp(options) + app.isProd = false await app.process() return app.dev() } async function build (options) { const app = createApp(options) + app.isProd = true await app.process() return app.build() } diff --git a/packages/@vuepress/core/lib/node/App.js b/packages/@vuepress/core/lib/node/App.js index e21c8ce29b..797e81338f 100755 --- a/packages/@vuepress/core/lib/node/App.js +++ b/packages/@vuepress/core/lib/node/App.js @@ -459,7 +459,6 @@ module.exports = class App { */ async dev () { - this.isProd = false this.devProcess = new DevProcess(this) await this.devProcess.process() const error = await new Promise(resolve => { @@ -489,7 +488,6 @@ module.exports = class App { */ async build () { - this.isProd = true this.buildProcess = new BuildProcess(this) await this.buildProcess.process() await this.buildProcess.render()