Skip to content

Commit 73ae6ad

Browse files
committed
refactor: adjust warn method treeshaking
1 parent 25c726e commit 73ae6ad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/runtime-core/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ export { useSSRContext, ssrContextKey } from './helpers/useSsrContext'
116116

117117
export { createRenderer, createHydrationRenderer } from './renderer'
118118
export { queuePostFlushCb } from './scheduler'
119-
export { warn } from './warning'
119+
import { warn as _warn } from './warning'
120+
export const warn = (__DEV__ ? _warn : NOOP) as typeof _warn
121+
120122
/** @internal */
121123
export { assertNumber } from './warning'
122124
export {

packages/runtime-core/src/warning.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export function popWarningContext() {
3131
}
3232

3333
export function warn(msg: string, ...args: any[]) {
34-
if (!__DEV__ && !__FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__) return
35-
3634
// avoid props formatting or warn handler tracking deps that might be mutated
3735
// during patch, leading to infinite recursion.
3836
pauseTracking()

0 commit comments

Comments
 (0)