File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ enum DevtoolsHooks {
2121 PERFORMANCE_END = 'perf:end'
2222}
2323
24- interface DevtoolsHook {
24+ export interface DevtoolsHook {
2525 enabled ?: boolean
2626 emit : ( event : string , ...payload : any [ ] ) => void
2727 on : ( event : string , handler : Function ) => void
Original file line number Diff line number Diff line change @@ -150,7 +150,18 @@ export const ErrorTypeStrings = (
150150) as typeof _ErrorTypeStrings
151151
152152// For devtools
153- export { devtools , setDevtoolsHook } from './devtools'
153+ import {
154+ devtools as _devtools ,
155+ setDevtoolsHook as _setDevtoolsHook ,
156+ DevtoolsHook
157+ } from './devtools'
158+
159+ export const devtools = (
160+ __DEV__ || __FEATURE_PROD_DEVTOOLS__ ? _devtools : undefined
161+ ) as DevtoolsHook
162+ export const setDevtoolsHook = (
163+ __DEV__ || __FEATURE_PROD_DEVTOOLS__ ? _setDevtoolsHook : NOOP
164+ ) as typeof _setDevtoolsHook
154165
155166// Types -------------------------------------------------------------------------
156167
@@ -377,6 +388,7 @@ import {
377388 softAssertCompatEnabled
378389} from './compat/compatConfig'
379390import { resolveFilter as _resolveFilter } from './helpers/resolveAssets'
391+ import { NOOP } from '@vue/shared'
380392
381393/**
382394 * @internal only exposed in compat builds
You can’t perform that action at this time.
0 commit comments