Bower does not download git submodule (DojoX candidate plugin)

前端 未结 1 482
伪装坚强ぢ
伪装坚强ぢ 2021-01-25 22:04

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

$ bower install dojo dijit dojox
bower dijit#*                   cached git://github.com/do         


        
相关标签:
1条回答
  • 2021-01-25 22:44

    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.

    0 讨论(0)
提交回复
热议问题