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
Post a Comment