Code Monkey home page Code Monkey logo

rolldash's Introduction

Rolldash (Node 8+)

npm

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.