Reputation: 293
How do I custom build lodash for node.js projects? I don't want any opera, IE, firefox based code in the custom build as i will always be using v8. Is it possible? kindly help.
Upvotes: 1
Views: 4633
Reputation: 27445
Simply install npm install --save lodash
Use wherever needed with with
const _ = require('lodash');
const array = [1];
const other = _.concat(array, 2, [3], [[4]]);
Upvotes: 0
Reputation: 26253
From the docs:
Use the
exports
argument to pass comma separated names of ways to export theLoDash
function.
Valid exports are “amd”, “commonjs”, “global”, “node”, and “none”.
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
More on generating custom builds here.
Upvotes: 1
Reputation: 203251
There's an existing Node package for lodash:
npm install lodash
Upvotes: 4