How to build a Sencha ExtJS application

To build a Sencha ExtJS application, move to your project’s root directory, then run this command:

$ sencha app build

Assuming that the build works fine, you can test the production build in your browser at a URL like this:

http://localhost:9090/build/production/Radio/

This URL assumes several things:

  • You normally serve your dev/test app from http://localhost:9090/
  • Your app is named Radio (the name you define in Ext.application, such that your classes are named Radio.model.*, Radio.view.*, and so on).

This same build process may work for Sencha Touch apps, but I can neither confirm nor deny that at this time.

Deploying your production application

The files you need to deploy to your production server are all under the build/production/Radio directory. When I look in that directory for my Radio application I see these files:

$ ls -al

drwxr-xr-x  5 al  admin      170 May 25 12:38 .
drwxr-xr-x  3 al  admin      102 May 25 12:37 ..
-rw-r--r--  1 al  admin  1013241 May 25 12:37 app.js
-rw-r--r--  1 al  admin      283 May 25 12:38 index.html
drwxr-xr-x  6 al  admin      204 May 25 12:37 resources

Just get those files to your root application directory on your production server and you should be in business.

(This is generally true, but you will probably have to do some extra work depending on how much you’ve customized your application. See pp. 273+ of Mastering Ext JS by Loiane Groner for more information.)