Socket
Socket
Sign inDemoInstall

lodash-webpack-plugin

Package Overview
Dependencies
1
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lodash-webpack-plugin

Smaller modular Lodash builds.


Version published
Weekly downloads
106K
decreased by-7.35%
Maintainers
3
Install size
1.36 MB
Created
Weekly downloads
 

Readme

Source

lodash-webpack-plugin v0.8.2

Create smaller Lodash builds by replacing feature sets of modules with noop, identity, or simpler alternatives.

This plugin complements babel-plugin-lodash by shrinking its cherry-picked builds even further!

Install

$ npm i --save lodash
$ npm i --save-dev lodash-webpack-plugin babel-core babel-loader babel-plugin-lodash babel-preset-es2015 webpack

Example

demo

Usage

webpack.config.js
var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
var webpack = require('webpack');

module.exports = {
  'module': {
    'loaders': [{
      'loader': 'babel',
      'test': /\.js$/,
      'exclude': /node_modules/,
      'query': {
        'plugins': ['lodash'],
        'presets': ['es2015']
      }
    }]
  },
  'plugins': [
    new LodashModuleReplacementPlugin,
    new webpack.optimize.OccurenceOrderPlugin,
    new webpack.optimize.UglifyJsPlugin
  ]
};

Opt-in to features with an options object:

new LodashModuleReplacementPlugin({
  'collections': true,
  'paths': true
});

Feature Sets

The following features are removed by default (biggest savings first):

FeatureDescription
shorthandsIteratee shorthands for _.property, _.matches, & _.matchesProperty.
cloningSupport for “clone” methods & cloning source objects.
curryingSupport for “curry” methods.
cachingCaches for methods like _.cloneDeep, _.isEqual, & _.uniq.
collectionsSupport for objects in “Collection” methods.
coercionsCoercion methods like _.toInteger, _.toNumber, & _.toString.
guardsGuards for arguments objects, host objects, sparse arrays, & other edge cases.
flatteningSupport for “flatten” methods & flattening rest arguments.
pathsDeep property path support for methods like _.get, _.has, & _.set.
memoizingSupport for _.memoize & memoization.
chainingComponents to support chain sequences.
metadataMetadata to reduce wrapping of bound, curried, & partially applied functions.
(requires currying)
placeholdersArgument placeholder support for “bind”, “curry”, & “partial” methods.
(requires currying)

Keywords

FAQs

Last updated on 25 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc