JSBuilder3 is a JavaScript packaging tool developed by Sencha and distributed as part of their SDK Tools.  Ext4 is built with JSBuilder so it made sense to investigate using it for the next generation of our own SDK.  There is not much public documentation available on how to configure a build yet so I thought I’d share what I learned during my last hackathon.

JSBuilder is neat because almost all of the build infrastructure is written in JavaScript.  Use JS to build JS?  Cool.  It uses Phantom, a headless instance of the WebKit engine as its interpreter.  The build pipeline goes something like this:

  • Analyze .jsb3 build file
  • Combine source files into packages
  • Combine packages into builds
  • Optionally compress output using YUI compressor
  • Copy resources (css, images, doc, etc).
  • Deploy all to target directory

The .jsb3 file is simply a JSON file that specifies what source files to include and in what order.  An example file might look like this:


All paths are relative to the .jsb3 file.  The corresponding file structure from the example above would look like this:


Building is as simple as invoking JSBuilder.sh:

./JSBuilder.sh -d “./animals” -p “./animals/animals.jsb3″

First the water and air packages are built and copied to the pkgs directory.  Those packages are then combined into the specified builds.  The second build is compressed using YUI compressor.  The tool analyzes each file included in the build and will report any script errors in its output- handy if something strange made it through JSLint and/or unit testing.

So far maintaining the .jsb3 file has been a manual process.  I haven’t had time to explore some of the more advanced features of the tool yet.  It is supposed to be able to auto-generate a build file by simply analyzing the script includes of your application page.  If we are diligent in using Ext.require in our code it should also be able to perform dependency analysis and create a smaller custom build of Ext4 as well.  Hopefully there will be a Part 2 to this post in the future.

For the currently available dojo-based App SDK we used dojo’s build system.
What other JS build tools have you used?  Pros/cons?

Request a Call

Looking for support?

Send Us Your Feedback

Provide us with some information about yourself and we'll be in touch soon. * Required Field