0
votes

I was trying to run the web version of hungry hero on my web hosting. But after I use "cocos compile -p web -m release" command to compile the cocos2d-Js and upload to my web hosting It displays the black screen. How could I solve this issues?

I'm using cocos2d-Js v3.0 rc3 on my system.

Here is the link to hungry hero on GitHub: https://github.com/kenkozheng/cocos2d-js/tree/master/hungry_hero

Any help is appreciate!

1
Were there no error messages un the console command? What about in the browser's javascript console? - Sebastián Vansteenkiste
Hi! My game is working now. The mistake was It's missing the src folder in the publish/html5 folder. But the compiled game.mini.js file is big large which is about 1600kB, is there any way to reduce the size of this file and speed up page loading's speed? - user3435575
No, the command for compiling packets all your source files into that minified Js file, it should not need you copying any folders or files by hand. We'll have to wait until someone has the time to download your entire project and try running it to see if we can find a solution. - Sebastián Vansteenkiste

1 Answers

0
votes

you should add your js files into project.json, the value of key "jslist" is an array which contains all your js files.

i think you have no idea about what the command "compile -p web -m release" doing

there is no need to run this command, if you just want to see your project work

it's used to compile all your js files into one compiled js file before publishing