If you’re writing any sort of Sencha app, you must aggregate and minify the JavaScript using the JSBuilder utility. Unfortunately, the JSBuilder utility is cryptic.

You can snag JSBuilder here.

Once you get it installed, you need to build a jsb3 file. Don’t try to build the jsb3 file on your own. The easiest way to create the jsb3 file is to use the following JSBuilder sencha command.

sencha create jsb -a http://localhost:8080/YourPath/index.html -p C:YourPathindex_app.jsb3 -v

This command will generate a jsb3 file in the YourPath directory by munging the contents of your index.html.

Open up the jsb3 file. It will be json. You should see all of your javascript files plus the required ExtJs ones. Some of the dependencies in ExtJs are screwed up so if you’re bold you can remove the ones that don’t make any sense to make your payload smaller, e.g. Svg.js.

Every time you want to build a minified version of your ExtJs app, you’ll then want to then invoke the following bit of JSBuilder code to use your jsb3 file as the equivalent of a makefile, and spit out some compressed and obfuscated JavaScript.

sencha build -p C:YourPathindex_app.jsb3 -d C:YourPath -v

This will spit out a lovely all-classes.js and app-all.js. You will then want to place the app-all.js in your production directory.