Skip to content

Commit

Permalink
Fix the problem due to multiple "./ " prefix cause taobao mini game c…
Browse files Browse the repository at this point in the history
…an not be required (cocos#14674)

* Fix the problem due to multiple "./ "  prefix cause taobao mini game can not be required
  • Loading branch information
bofeng-song authored Mar 28, 2023
1 parent 3a9ea05 commit aaf3736
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion templates/taobao-mini-game/game.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
globalThis.__taobaoRequire = (urlNoSchema) => {
require("./" + urlNoSchema);
if (urlNoSchema.startsWith('./')) {
urlNoSchema = urlNoSchema.replace('./', '');
}
require('./' + urlNoSchema);
};
loadCC();

Expand Down

0 comments on commit aaf3736

Please sign in to comment.