rolldash

0.1.2 • Public • Published

Rolldash (Node 8+)

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.

Usage

Installation

npm-script

npm i -D rolldash

CLI usage (npm-script)

rolldash [-v --version <latest|'4.0.0'>] [-c --config <path|'./rolldash.config.js'>] -o --output <path>

The above (as either an npm script) will do the following

  1. Fetches a local copy of Lodash of the specified version
  2. Reads the configuration file containing the regex/string names of valid Lodash exports
  3. 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.

Example

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.

Configuration

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.

Example configuration file

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.

Readme

Keywords

none

Package Sidebar

Install

npm i rolldash

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

8.6 kB

Total Files

8

Last publish

Collaborators

  • flynnham