Question

I am using dojo, dijit, dojox in my project, they are installed with:

$ bower install dojo dijit dojox
bower dijit#*                   cached git://github.com/dojo/dijit.git#1.9.3
bower dijit#*                 validate 1.9.3 against git://github.com/dojo/dijit.git#*
bower dojo#*                    cached git://github.com/dojo/dojo.git#1.9.3
bower dojo#*                  validate 1.9.3 against git://github.com/dojo/dojo.git#*
bower dojox#*                   cached git://github.com/dojo/dojox.git#1.9.3
bower dojox#*                 validate 1.9.3 against git://github.com/dojo/dojox.git#*

Everything is fine until I discover dojox.calendar is missing. This is a candidate plugin for DojoX and using it from the DojoX git repository (git cloned from Github) requires "git submodule update --init --recursive".

My options are:

  • Can I get Bower to download this git submodule?
  • Or should I download this module separate from the dojox package via a normal git clone and just symlink dojox/calendar to it? This would mean I have to maintain this link every time bower updates the dojox packages, right?

UPDATE: I've just discovered bower install accepts git URLs as parameters, however it outputs a single index HTML file that is most definitely not the module I need.

Was it helpful?

Solution

Dojo does not really support to be installed through Bower. When you use the following command:

bower install dojo dijit dojox

All source files, tests, docs, ... are downloaded and not only the production-ready minified files. This is not really a "huge" problem, but it will leave a bigger footprint behind.


Back to your problem, I don't think it's possible at the moment to make Bower install Dojo as you indeed need to include the submodules, which you could install through:

git clone --recursive git@github.com:dojo/dojox

You can report this to the Bower team to make them support the --recursive part or you report this to the Dojo team, to make them support Bower (and only having minified/production files).


Right now, the best thing you could do is not to use Git for your Bower repository. With Bower you could actually load an external archive file as well, containing all files you need.

So in your case it would be:

bower install dojo=http://download.dojotoolkit.org/release-1.9.3/dojo-release-1.9.3.tar.gz

This will provide you the following directory structure:

  • bower_components
    • dojo
      • dijit
      • dojo
      • dojox

Another alternative is to make your own Dojo build and hosting it on a private Git repository. This might be a good solution for enterprises because it allows you to come with a unified Dojo build for all applications at the enterprise.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top