mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
fix NATIVE undefined in module 'cc/env' (#9023)
This commit is contained in:
Vendored
+2
@@ -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;
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user