Hi,
I would like to publish a Cocos2d-JS v3.7 project to Android/iOS/Web platform but can’t make them work properly when minified and obfuscated.
cocos compile -p web -m release --advanced
For Web, we can use this command to minify and obfuscate all source files into 1 file named game.min.js.
It created a folder named “html5”, i try to run the page index.html in localhost with google chrome, the page load to 6x% and stuck there.
When i refresh or reopen the page, it stuck at 0%.
The game.min.js is around 2.2MB.
cocos compile -p android -m release
For Android, this commnad compile the project and publish with a keystore.
The .apk file can be run successfully.
When i extract the .apk file, i can see all the source file are processed by google closure compiler into separately .jsc files.
Is there any command to compile and publish project with only 1 minified and obfuscated source file?
cocos compile -p iOS -m release
For iOS, this only generated a file end with .app but not .ipa
Although, the source files are processed into .jsc.
I try archive the project with Xcode but the source files are not processed into .jsc.
Then i found this Cocos jscompile guide.
http://cocos2d-x.org/wiki/Cocos_jscompile
cocos jscompile -s ./src -s ./script -d ./src -c -o test.js
This code give me error
Internet Explorer, Closure Compiler and Trailing Commas
I have a third party library .js file which i remove the comma, it won’t work.
I try use extra --closure_params but not working.
cocos jscompile -s ./src -s ./script -d ./src -c -o test.js -m internetExplorerChecks
How can i pass this params to closure compiler to ignore the Internet Explorer error?
--jscomp_off=internetExplorerChecks
Please give me some guide on how to publish Cocos2d-JS project.
The Cocos2d-JS is a great engine for multi platform. But the publish process very troublesome
Thanks!