This plugin requires Grunt
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-dojo-alt-build --save-dev
or by using the
In your project's Gruntfile, add a section named
dojo_alt_build to the data object passed into
An object listing the local packages in dojoConfig that should be built.
Type: file list
A list of js modules and html templates to be concatenated and minified. (note: this is a sibling to, not within, the
See Grunt documentation for different structure options.
For a project with dojoConfig:
var dojoConfig =parseOnLoad: truepackages:name: 'app'location: locationPath + 'js/app'name: 'components'location: locationPath + 'js/components'name: 'config'location: locationPath + 'js/config';
app target for the
dojo_alt_build task looks like this (assuming a
config module that should be excluded from the build process).
dojo_alt_build:app:options:pkgs:// list the local packages in dojoConfig that should be built.// (don't include config package here)'app': 'js/app''components': 'js/components'files:'release/js/app.min.js':// all js and html files from the js folder except config'js/**/*.js''js/**/*.html''!js/config/*'
release/index.html would include a script tag to import the built modules,
and a require statement to the module that kicks off the application.