Skip to content

Commit 3e9e295

Browse files
add cocos attr to the script element in templates
To build project.json path, CCBoot.js is looking for a script element with a cocos attribute. If element is not found, it loads project.json from the current URL. cocos attribute should be added in the template, because it is the default CCBoot.js' behaviour, and usually, project.json is located with game.min.js file. https://github.com/cocos2d/cocos2d-html5/blob/develop/CCBoot.js#L2159
1 parent 6ab3c4e commit 3e9e295

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/js-template-default/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
<script src="src/loading.js"></script>
2424
<canvas id="gameCanvas" width="800" height="450"></canvas>
2525
<script src="frameworks/cocos2d-html5/CCBoot.js"></script>
26-
<script src="main.js"></script>
26+
<script cocos src="main.js"></script>
2727
</body>
28-
</html>
28+
</html>

templates/js-template-runtime/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
<body style="padding:0; margin: 0; background: #000;">
2323
<canvas id="gameCanvas" width="800" height="450"></canvas>
2424
<script src="frameworks/cocos2d-html5/CCBoot.js"></script>
25-
<script src="main.js"></script>
25+
<script cocos src="main.js"></script>
2626
</body>
27-
</html>
27+
</html>

0 commit comments

Comments
 (0)