mirror of https://github.com/vuejs/core.git
build: avoid exporting setDevTools in global prod build
This commit is contained in:
parent
b4ebe7ae8b
commit
ee68c525f0
|
@ -21,7 +21,7 @@ enum DevtoolsHooks {
|
||||||
PERFORMANCE_END = 'perf:end'
|
PERFORMANCE_END = 'perf:end'
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DevtoolsHook {
|
export interface DevtoolsHook {
|
||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
emit: (event: string, ...payload: any[]) => void
|
emit: (event: string, ...payload: any[]) => void
|
||||||
on: (event: string, handler: Function) => void
|
on: (event: string, handler: Function) => void
|
||||||
|
|
|
@ -150,7 +150,18 @@ export const ErrorTypeStrings = (
|
||||||
) as typeof _ErrorTypeStrings
|
) as typeof _ErrorTypeStrings
|
||||||
|
|
||||||
// For devtools
|
// For devtools
|
||||||
export { devtools, setDevtoolsHook } from './devtools'
|
import {
|
||||||
|
devtools as _devtools,
|
||||||
|
setDevtoolsHook as _setDevtoolsHook,
|
||||||
|
DevtoolsHook
|
||||||
|
} from './devtools'
|
||||||
|
|
||||||
|
export const devtools = (
|
||||||
|
__DEV__ || __FEATURE_PROD_DEVTOOLS__ ? _devtools : undefined
|
||||||
|
) as DevtoolsHook
|
||||||
|
export const setDevtoolsHook = (
|
||||||
|
__DEV__ || __FEATURE_PROD_DEVTOOLS__ ? _setDevtoolsHook : NOOP
|
||||||
|
) as typeof _setDevtoolsHook
|
||||||
|
|
||||||
// Types -------------------------------------------------------------------------
|
// Types -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -377,6 +388,7 @@ import {
|
||||||
softAssertCompatEnabled
|
softAssertCompatEnabled
|
||||||
} from './compat/compatConfig'
|
} from './compat/compatConfig'
|
||||||
import { resolveFilter as _resolveFilter } from './helpers/resolveAssets'
|
import { resolveFilter as _resolveFilter } from './helpers/resolveAssets'
|
||||||
|
import { NOOP } from '@vue/shared'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal only exposed in compat builds
|
* @internal only exposed in compat builds
|
||||||
|
|
Loading…
Reference in New Issue