Configuration to load YUI locally

From what I understand the default behaviour for Mojito to load YUI
(on client side?) is to use combo loader from yahooapis:

But for whatever reason sometimes I find (from the firebug network
panel) that the connection has failed (timed out) when the above
request was sent.
So my question is how do I configure Mojito to load YUI from local
directory instead?
I followed the documentation to include the following yui config in
   "settings": [ "master" ],
   "yui": {
     "showConsoleInClient": false,
     "config": {
        "fetchCSS": false,
        "combine": true,
        "comboBase": 'http://mydomain.com/combo?',
        "root": 'yui3/'
But this does not seem to do anything, I still see the request sent to
yui.yahooapis.com. I even tried just setting combine:false but still
it was sending out combo string.
If the above attempt to set yui directory failed, will it generate any
error message?
Also where in my Mojito project should I store this yui directory and
how can I reference to it from Mojito (/static/??) ?
Any help would be greatly appreciated, thanks!

2 Replies
  • I have a solution.

    In mojito module (0.3.27-0.3.28 tested)
    -for local install of mojito:
    -for global install of mojito:
    at line 157:
    instead of
    combo.js = this._createURLlist(loader.comboBase, comboJsParts);
    combo.js = this._createURLlist(this.appConfig.yui.comboBase || loader.comboBase, comboJsParts);
    at line 158:
    instead of
    combo.css = this._createURLlist(loader.comboBase, comboCssParts);
    combo.css = this._createURLlist(this.appConfig.yui.comboBase || loader.comboBase, comboCssParts);
    and then put

            "yui": {
                "comboBase": "/yui/combo?"

    into application.json

    it works well for me, with second server on node.js that serves combined yui urls - but if you want - they can be merged simply.

    For serving combined yui - try combohandler:
    npm install combohandler
    nice tool to combine js and css - works with yui - sample exists on github. you can integrate it via middleware, and mojito server will serve yui (but it seems for me, that dedicated server for yui combining is a good practice - it tooks pretty much time to process request)
  • Alexey:
    Thanks for helping out! We really appreciate it.
    Your patch would make a great pull request, and we can incorporate it into the Mojito tree.
    Would you like to submit one? Here is how to get started:


Recent Posts

in Yahoo! Mojito