fix NATIVE undefined in module 'cc/env' (#9023)

This commit is contained in:
PP
2021-07-21 09:47:57 +08:00
committed by GitHub
parent 4df80e89f4
commit fcb1792ba2
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -41,6 +41,8 @@ declare module 'internal:constants' {
/**
* Running in native platform (mobile app, desktop app, or simulator).
*/
export const NATIVE: boolean;
export const JSB: boolean;
export const HTML5: boolean;
+1
View File
@@ -46,6 +46,7 @@ export const PREVIEW = tryDefineGlobal('CC_PREVIEW', !EDITOR);
export const DEV = tryDefineGlobal('CC_DEV', true); // (CC_EDITOR && !CC_BUILD) || CC_PREVIEW || CC_TEST
export const DEBUG = tryDefineGlobal('CC_DEBUG', true); // CC_DEV || Debug Build
export const JSB = tryDefineGlobal('CC_JSB', defined('jsb'));
export const NATIVE = JSB;
export const HTML5 = false;
// @ts-expect-error
export const WECHAT = tryDefineGlobal('CC_WECHAT', !!(defined('wx') && (wx.getSystemInfoSync || wx.getSharedCanvas)));