This module uses rollup to create a selectively minified build of lodash
using npm scripts. This package was made in response to the deprecation of the official lodash-cli
utility.
npm i -D rolldash
rolldash [-v --version <latest|'4.0.0'>] [-c --config <path|'./rolldash.config.js'>] -o --output <path>
- Fetches a local copy of Lodash of the specified version
- Reads the configuration file containing the regex/string names of valid Lodash exports
- The build script dynamically generates a build script in memory and uses it to build a selectively exported version of Lodash locally to the specified output location.
rolldash -v 4.0.1 ./build/lodash.js
The above will fetch version 4.0.1 of Lodash, use rolldash.config.js
in the current
working directory, and output the file to ./build/lodash.js
relative to the current
working directory.
The configuration file used by the build tool is specified by a simple module export
of an object containing use
with allows for both strings and regular expressions.
module.exports = {
compressor: {
// uglifyJS2 settings
},
use: [
'map',
/difference/,
],
};
The above will match any Lodash exports exactly named map
, and any exports containing the word difference
. The build script will output the detected exports when run.