Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/useWinClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default function useWinClick(
}

// Warning if target and popup not in same root
if (process.env.NODE_ENV !== 'production') {
const targetRoot = targetEle?.getRootNode?.();
if (process.env.NODE_ENV !== 'production' && targetEle) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样会不会导致这部分代码不会从 production 环境移除,从而使体积变大?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uglify 会短路,中间有 falsy 就会删掉。

const targetRoot = targetEle.getRootNode?.();
const popupRoot = popupEle.getRootNode?.();

warning(
Expand Down
Loading