knockout.js - What is the purpose of config and shim in RequireJS -


i trying use requirejs knockout in mvc4 project . when started learning require js found following code @ many places .

requirejs.config({ shim: {     'backbone': {         deps: ['underscore', 'jquery'],         exports: 'backbone'     }      }   }); 

i need know why config block use . shim inside config , why use , benefits .

thanks in advance .

"shim: configure dependencies, exports, , custom initialization older, traditional "browser globals" scripts not use define() declare dependencies , set module value."

http://requirejs.org/docs/api.html#config-shim

meaning: backbone not support requirejs out of box, hence have define dependencies yourself.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -