简体   繁体   中英

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

I'm trying to edit the bundled sencha-touch.jsb3 file in attempt to reduce the size of the framework code.

Here's where I am so far:

  1. Download the Sencha SDK Tools from http://www.sencha.com/products/sdk-tools/

  2. Edit SenchaTouch/sencha-touch.jsb3 , specifically, I changed

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

    to

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

I got the sencha-touch.js file successfully built, with comments, white spaces and all that good stuff in it. However, when the command proceed to " Compress and obfuscate sencha-touch.js ", it (more specifically, yuicompressor ) complains that there are several syntax error and refuses to minify the file.

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

What my setup does it that I use JSBuilder to build a unified file, and later use ycompressor to compress that js file.

Here is my one-click batch file, 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 original sencha-touch.jsb3, and additionally my own js files for my sencha app.

Hope this helps you and other readers..

(ps. maybe there should be a jsb3 tag)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM