Why did Underscore.js remove support for AMD?

前端 未结 4 496
温柔的废话
温柔的废话 2020-12-08 00:07

1.3.0 — Jan. 11, 2012 Removed AMD (RequireJS) support from Underscore. If you\'d like to use Underscore with RequireJS, you can load it as a normal script, w

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-08 00:39

    ES5-shim provides many of the same features as underscore and lodash (array.forEach(), array.map() etc).

    ES5-shim natively supports AMD, unlike underscore and lodash, doesn't add extra copies of things your browser probably already provides. Rather it adds native ES5 features to older browsers.

    When IE8 and other older browsers die out, you can simply remove the ES5-shim dependency without having to port code like you would with lodash or underscore.

提交回复
热议问题