##Dojo Boilerplate/CMV
Create fast, optimized CMV builds using The Dojo Build System
- Make sure you have Node.js and a Java runtime installed.
- Clone the repository using
git clone --recursive
. - Run
npm install
to install additional Node.js dependencies. - Install globally grunt-cli with
npm install -g grunt-cli
- Run
grunt slurp
to download the esri api (v3.13) into the src folder - Develop your project in
src/
until it is amazing. - Run
build.sh
, which will create an awesome optimised build indist/
. - Upload
dist/
for millions of people the world over to enjoy. - Hapyness.
If you have msysgit installed, run Git Bash and verify some dependencies by running the following commands:
which java
which node
###Before and after Esri applications require many files. The dojo build system scans and compresses required files into one, which is referred to as a layer. Here are the results for the CMV App after a dojo build has completed:
Item | Before Build | After Build |
---|---|---|
Javascript Requests | 487 files | 9 files |
CSS Requests | 21 files | 1 file |
HTML Requests | 42 files | 1 file |
Images | 24 files | 24 files |
firebug onload | 8.93 seconds | 3.13 seconds |
chromium load | 1.14 seconds | 690-710 milliseconds |
load times were tested on local dev server
- All of the application's source goes in
src
. It will be built intodist
. - Build profiles for the build system go in
profiles
. - The entrypoint of the demo application is the HTML file at
src/index.html
. - The
build.sh
script takes your application files and builds them for production use using Stylus and the Dojo build system. It depends on the presence of an application build profile atprofiles/app.profile.js
. - The file
src/app/resources/app.styl
contains all the CSS for the application. - Tests using Intern exist in the
tests
directory. They can be run withtests/run.sh
. The test configuration is attests/intern.js
and defaults to using a Sauce Labs tunnel.
This boilerplate is occasionally updated to try to reflect the latest and greatest features and design patterns for writing Web apps with Dojo, but it relies heavily on information and contributions from other users. If you have an idea, suggestion, or problem, please report it or create a pull request! (Please note that you will need to have signed the Dojo CLA before your pull requests are accepted, for the good of us all!)
The Dojo Boilerplate is licensed under the New BSD license.