A collection of Lo-Dash methods as AMD modules generated by lodash-cli.
Define a build as 'lodash'
(instead of 'lodash-amd/{build}'
)
require({
'packages': [
{ 'name': 'lodash', 'location': 'lodash-amd/modern' }
]
}, ['lodash/collections/forEach'], function(forEach) {
// use `forEach`
});
Easily migrate Underscore code to Lo-Dash code.
require({
'packages': [
{ 'name': 'lodash', 'location': 'lodash-amd/compat' },
{ 'name': 'underscore', 'location': 'lodash-amd/underscore' }
]
}, [], function() {});
When working with code that must have Underscore compatibility, just import the 'underscore'
dependency.
If you don’t need Underscore compatibility & want the benefits of Lo-Dash, import the 'lodash'
dependency.
You can even mix & match.
define(['underscore', 'lodash/objects/transform'], function(_, transform) {
// use `_` prefixed code with underscore
// use `transform` from lodash
});
Eventually, when Underscore compatibility is no longer needed, just switch your packages
configuration.
require({
'packages': [
{ 'name': 'lodash', 'location': 'lodash-amd/compat' },
{ 'name': 'underscore', 'location': 'lodash-amd/compat' }
]
}, [], function() {});
John-David Dalton |
Blaine Bublitz | Kit Cambridge | Mathias Bynens |