A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
// Emscripten extern-pre-js for WeChat MiniGame
// Provides minimal browser globals that -sENVIRONMENT=web assumes exist.
// Injected OUTSIDE the module IIFE, so these are available at module evaluation time.
//
// IMPORTANT: Keep this minimal. Only provide what Emscripten's module-level
// code needs (specialHTMLTargets references document/window). Do NOT provide
// createElement/body/etc — SDK code uses their absence to detect non-browser
// environments and skip DOM-dependent features (e.g. TextInputPlugin).
if (typeof window === 'undefined') { globalThis.window = globalThis; }
if (typeof document === 'undefined') { globalThis.document = {}; }