Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update env to support import.meta #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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