Skip to content

Conversation

wssgcg1213
Copy link
Contributor

@wssgcg1213 wssgcg1213 commented Jan 4, 2023

// This requires webpack >= 5 to identify the import.meta object.
const hasImportMeta = typeof import.meta !== 'undefined';

export const isWeb = hasImportMeta ? import.meta.target === 'web' : (typeof window !== 'undefined' && 'onload' in window);
Copy link
Member

Choose a reason for hiding this comment

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

兜底判断条件没变化吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

没变化的

Copy link
Contributor

Choose a reason for hiding this comment

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

确认一下 ssr 场景下是否可用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants