diff --git a/templates/taobao-mini-game/game.ejs b/templates/taobao-mini-game/game.ejs index 0c5f811417f..3ae735585bd 100644 --- a/templates/taobao-mini-game/game.ejs +++ b/templates/taobao-mini-game/game.ejs @@ -1,4 +1,7 @@ -globalThis.window = globalThis; + +if (!globalThis.window) { + globalThis.window = globalThis; +} globalThis.self = $global; globalThis.__taobaoRequire = (urlNoSchema) => { @@ -71,7 +74,6 @@ function loadCC() { function onApplicationCreated(application) { return System.import('cc').then((cc) => { - globalThis.cc = cc; require('./engine-adapter'); return application.init(cc); }).then(() => { return application.start(); });