From d5c873beedf4e9b576034dbc889e2648e6806faa Mon Sep 17 00:00:00 2001 From: underfin Date: Tue, 29 Dec 2020 18:39:22 +0800 Subject: [PATCH 1/2] fix: init devtools in production --- packages/vue/src/index.ts | 2 +- packages/vue/src/runtime.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index c810d03eb92..bfed7dea481 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -7,7 +7,7 @@ import * as runtimeDom from '@vue/runtime-dom' import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared' import { InternalRenderFunction } from 'packages/runtime-core/src/component' -__DEV__ && initDev() +;(__DEV__ || __FEATURE_PROD_DEVTOOLS__) && initDev() const compileCache: Record = Object.create(null) diff --git a/packages/vue/src/runtime.ts b/packages/vue/src/runtime.ts index b78d60c9935..e0034eaef4e 100644 --- a/packages/vue/src/runtime.ts +++ b/packages/vue/src/runtime.ts @@ -3,7 +3,7 @@ import { initDev } from './dev' import { warn } from '@vue/runtime-dom' -__DEV__ && initDev() +;(__DEV__ || __FEATURE_PROD_DEVTOOLS__) && initDev() export * from '@vue/runtime-dom' From c1de7fad10f4c8960e70e02281360cca25ff6c9a Mon Sep 17 00:00:00 2001 From: underfin Date: Tue, 29 Dec 2020 19:28:30 +0800 Subject: [PATCH 2/2] fix: adjust code style --- packages/vue/src/index.ts | 4 +++- packages/vue/src/runtime.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index bfed7dea481..62445c0f411 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -7,7 +7,9 @@ import * as runtimeDom from '@vue/runtime-dom' import { isString, NOOP, generateCodeFrame, extend } from '@vue/shared' import { InternalRenderFunction } from 'packages/runtime-core/src/component' -;(__DEV__ || __FEATURE_PROD_DEVTOOLS__) && initDev() +if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { + initDev() +} const compileCache: Record = Object.create(null) diff --git a/packages/vue/src/runtime.ts b/packages/vue/src/runtime.ts index e0034eaef4e..d69ab48b4f9 100644 --- a/packages/vue/src/runtime.ts +++ b/packages/vue/src/runtime.ts @@ -3,7 +3,9 @@ import { initDev } from './dev' import { warn } from '@vue/runtime-dom' -;(__DEV__ || __FEATURE_PROD_DEVTOOLS__) && initDev() +if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { + initDev() +} export * from '@vue/runtime-dom'