Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BB 1.1.2 + lodash + requirejs

How to implement lodash with new version of BB 1.1.1 or 1.1.2, which has AMD wrapper? And how to exports Backbone into global scope, with requirejs?

1.1.0 - without amd wrapper, works good. Thnk's.

like image 830
Serhey Avatar asked Dec 15 '22 01:12

Serhey


1 Answers

If you have libraries that depend on lodash explicitly, such as lodash-template-loader, you will need to use this:

paths: {
    lodash: <path to lodash>,
    ....
},
map: {
  "*": {
    "underscore": "lodash"
  }
}

At that point, any dependency on underscore will load lodash instead, and the template loader will work.

like image 134
webXL Avatar answered Dec 30 '22 08:12

webXL