Custom builds make it easy to create lightweight versions of Lodash containing only the features you need. To top it off, we handle all function dependency & alias mapping for you. Review the build differences & pick the one that’s right for you.
The Lodash command-line interface is available when
lodash-cli is installed as a global package:
$ npm i -g npm$ npm i -g lodash-cli$ lodash -h
categorycommand to pass comma separated categories of functions to include in the build. Valid categories are “array”, “collection”, “date”, “function”, “lang”, “object”, “number”, “seq”, “string”, & “util”.
exportscommand to pass comma separated names of ways to export the
lodashfunction. Valid exports are “amd”, “commonjs”, “es”, “global”, “node”, “npm”, “none”, & “umd”.
iifecommand to specify code to replace the IIFE that wraps Lodash.
includecommand to pass comma separated names of functions to include in the build.
minuscommand to pass comma separated function/category names to remove from the build.
pluscommand to pass comma separated function/category names to add to the build.
lodash category=array plus=random,template
templatecommand to pass the file path pattern used to match template files to precompile. Note: Precompiled templates are assigned to the
settingscommand to pass template settings used when precompiling templates.
moduleIdcommand to specify the AMD module ID for Lodash or the module ID used to include Lodash in compiled templates. Use “none” as the module ID to create compiled templates without a dependency on Lodash.
exportsvalues “es” & “npm” may only be used in conjunction with the
modularizecommand uses the first
exportsvalues as its module format, ignoring subsequent values
--outputall files created are saved to the current working directory
The following options are also supported:
--stdout................ Write output to standard output
--development..... Write only the non-minified development output
--help.................... Display help information
--source-map....... Generate a source map using an optional source map URL
--output................ Write output to a given path/filename
--production....... Write only the minified production output
--silent............... Skip status updates normally logged to the console
--version............. Output current version of Lodash