Dojo Boilerplate: A Starter Kit for Dojo Development
The Dojo Boilerplate is a set of files to help you rapidly get up and running with the Dojo Toolkit. It illustrates some basic best practices when working with Dojo. The master branch uses the standard Dojo build system; if you're feeling adventurous, there is also a branch that uses AMD modules and is built using RequireJS.
Huge thanks go out to neonstalwart for his original dojo-requirejs-template project. Though that repository is no longer maintained, it was instrumental in providing guidance for integrating RequireJS with Dojo 1.6.
- Clone the repository.
util/setup.shto automatically download all required dependencies.
- Develop your project in
www/until it is amazing.
util/build.sh, which will create an awesome optimised build in
dist/for millions of people the world over to enjoy.
If you already have a clone of the repo, and just want to create a new
instance of it, run
make new=/dir/to/create, and it will copy the files to
the directory you specify.
If you have Git for Windows installed, boot up Git Bash and verify some dependencies by running the following commands:
which java which curl
curl are available then
cd to your project directory and
follow the Quick Start instructions above. Currently, Git Bash doesn't ship
make, so running the MakeFile won't work from Git Bash.
A brief tour
- The starting point of the boilerplate is the file at
www/index.html. This file is responsible for loading base Dojo, telling Dojo where to look for modules in the
- The file
- The file
util/build.shtakes your application files and builds them for production use using the Dojo build tool. It depends on the presence of the bootstrapping file at
www/js/app/base.js, and a "profile" file at
- The file
www/css/app.csscontains import statements to load the CSS for Dojo's Claro theme. If you are not using Dijit widgets, you probably want to remove these imports!
- The directory
www/js/dbpcontains tools you may find useful. These tools are a work in progress.
The Dojo Boilerplate is licensed under the same terms as the Dojo Toolkit. Consult the individual projects (see the Useful resources section above) for additional licensing information.