Hi, I’ve been in HTML5 gamedev for a while and have been separating my own game engine and my game code, and used my own compiler to make it work that way.
Now I’m migrating to Cocos2d-JS and tried to compile a default new project with cocos compile -p web -m release. I can see the final result is on publish/html5, but JS code become game.min.js, which includes cocos engine, app + resource.js files, my source files, and main.js.
My problem is, I want to separate this game.min.js into 2 parts; cocos game engine as its own external script and then followed with another script containing my own game code that includes my JS files and the provided app + resouce + main JS files on my own implementation so it becomes like this:
...
<script type='text/javascript' src='res/cocos2d-js-v3.7-min.js'></script>
<script type='text/javascript' src='res/my.game.code.js'></script>
...
I can find my own workaround on producing the engine from the cocos2d-html5 build.xml and make my script to produce it directly, but I can’t find a way to separate the whole game.min.js.
I’ve tried to mess up with the genBuildXml.xml, publish.js, and the build.xml template in /frameworks/cocos2d-html5/tools folder to not combine the game engine also the main.js, but I couldn’t make them work.
Lastly, please let me know if this is not recommended for reasons like messing up the native compilation and such.
Thanks!