How to create Sencha Touch with sencha-touch.jsb3?

I am trying to edit the associated sencha-touch.jsb3 file to reduce the size of the frame code.

Here, where I am still:

  • Download Sencha SDK tools from http://www.sencha.com/products/sdk-tools/

  • Edit SenchaTouch/sencha-touch.jsb3 , in particular, I changed

     ... "builds": [ { ... "debug": true, ... 

    to

     ... "builds": [ { ... "debug": false, "compress": true, ... 
  • Run sencha build -p path/to/sencha-touch.jsb3 -d path/to/result/

I got a sencha-touch.js file that was created successfully, with comments, spaces and all the good things. However, when the command goes to "Compress and obfuscate sencha-touch.js", he (more precisely, yuicompressor) complains that there are several syntax errors and refuses to minimize the file.

If you have successfully overcome this problem, I would really appreciate it if you can share your experience here.

+4
source share
1 answer

What my setup does is that I use JSBuilder to create a single file, and then use ycompressor to compress this js file.

Here is my batch file with one click, hope it works for you.

 cd C:\wamp\www\sencha-touch-1.1.1\jsbuilder CALL JSBuilder.bat -v -p "C:\wamp\www\my-sencha-project\mobile_app_deploy.jsb3" -d "C:\wamp\www\my-sencha-project\" java -jar ycompressor\ycompressor.jar --charset utf8 -o C:\wamp\www\sencha-touch-1.1.1\jsbuilder\my-sencha-project-mini.js --nomunge C:\wamp\www\sencha-touch-1.1.1\jsbuilder\ybapp.js xcopy ybapp.js c:\wamp\www\my-sencha-project\js /y xcopy ybapp-mini.js c:\wamp\www\my-sencha-project\js\ /y pause 

* my mobile_app_deploy.jsb3 contains the source sencha-touch.jsb3 file and also my own js files for my sencha application.

Hope this helps you and other readers.

(ps. maybe there should be a jsb3 tag)

0
source

Source: https://habr.com/ru/post/1382950/


All Articles