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.
- Run
util/setup.sh
to automatically download all required dependencies. - Develop your project in
www/
until it is amazing. - Run
util/build.sh
, which will create an awesome optimised build indist/
. - Upload
dist/
for millions of people the world over to enjoy. - Hapyness.
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
If both java
and curl
are available then cd
to your project directory and
follow the Quick Start instructions above. Currently, Git Bash doesn't ship
with make
, so running the MakeFile won't work from Git Bash.
- 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 theapp
anddbp
namespaces, and finally loading your application's base JavaScript file. - The file
www/js/app/base.js
is your application's base JavaScript file. In it, you can specify dependencies on other files, including files you create. You can also write application code, though the code you write in this particular file should be limited to bootstrapping functionality. - The file
util/build.sh
takes your application files and builds them for production use using the Dojo build tool. It depends on the presence of the bootstrapping file atwww/js/app/base.js
, and a "profile" file atprofiles/app.js
. - The file
www/css/app.css
contains 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/dbp
contains 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.