Socket
Socket
Sign inDemoInstall

lodash-webpack-plugin

Package Overview
Dependencies
1
Maintainers
1
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
1
Install size
1.35 MB
Created
Weekly downloads
 

Readme

Source

lodash-webpack-plugin v0.1.0

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 LodashReplacementPlugin({
  'collections': true,
  'paths': true
});

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

FeatureDescription
shorthandsIteratee shorthands for _.property, _.matches, & _.matchesProperty.
collectionsSupport for objects in “Collection” methods like _.each, _.filter, & _.map.
curryingSupport for _.curry & _.curryRight.
cachingCaches using Map & Set for methods like _.cloneDeep, _.isEqual, & _.uniq.
coercionsCoercion methods like _.toInteger, _.toNumber, & _.toString.
pathsDeep property path support for methods like _.get, _.has, & _.set.
guardsDense array & iteratee call guards for methods like _.every, _.keys, & _.some.
metadataStore metadata to reduce wrapping of bound, curried, & partially applied functions.
(requires currying)
placeholdersArgument placeholder support for methods like _.bind, _.curry, & _.partial.
(requires currying)

Keywords

FAQs

Last updated on 06 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