Socket
Socket
Sign inDemoInstall

lodash-webpack-plugin

Package Overview
Dependencies
1
Maintainers
2
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
109K
increased by1.52%
Maintainers
2
Install size
1.35 MB
Created
Weekly downloads
 

Readme

Source

lodash-webpack-plugin v0.11.1

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.OccurrenceOrderPlugin,
    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 “clone” methods & cloning source objects.
curryingSupport “curry” methods.
cachingCaches for methods like _.cloneDeep, _.isEqual, & _.uniq.
collectionsSupport objects in “Collection” methods.
exoticsSupport objects like buffers, maps, sets, symbols, typed arrays, etc.
guardsGuards for host objects, sparse arrays, & other edge cases.
metadataMetadata to reduce wrapping of bound, curried, & partially applied functions.
(requires currying)
deburringSupport deburring letters.
unicodeSupport Unicode symbols.
chainingComponents to support chain sequences.
memoizingSupport _.memoize & memoization.
coercionsSupport for coercing values to integers, numbers, & strings.
flatteningSupport “flatten” methods & flattening rest arguments.
pathsDeep property path support for methods like _.get, _.has, & _.set.
placeholdersArgument placeholder support for “bind”, “curry”, & “partial” methods.
(requires currying)

Keywords

FAQs

Last updated on 22 Feb 2017

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