0.11.6 • Published 3 years ago

lodash-webpack-plugin v0.11.6

Weekly downloads
219,253
License
MIT
Repository
github
Last release
3 years ago

lodash-webpack-plugin

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!

DISCLAIMER: Using this plugin without enabling the proper feature sets may cause lodash functions to behave in unexpected ways. Methods may appear to work, however they might return incorrect results.

Install

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

Example

demo

Usage

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

module.exports = {
  'module': {
    'rules': [{
      'use': 'babel-loader',
      'test': /\.js$/,
      'exclude': /node_modules/,
      'options': {
        'plugins': ['lodash'],
        'presets': [['env', { 'modules': false, 'targets': { 'node': 4 } }]]
      }
    }]
  },
  'plugins': [
    new LodashModuleReplacementPlugin,
    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)
@plone/voltoxdf-nt@quantumblack/carbon-chartsgray-react-tools@ywjt/mpa-builder@ywjt/spa-builder@ywjt/spa-m-buildereduireact-scripts-rawrmonstar@memoryai/frontend-configweb-minecraft@futurelearn/webpack-config@designtobe/d2bcomponentshulionjsyco-runyc-run@everything-registry/sub-chunk-2094dk-webpack-configdmp-clicra-rewire-lodash-plugincounter-strikeumi-plugin-bundle-compressthis-is-a-uinavbartestehome-app-kitehome-scriptsdynamic-characteristicvantbase-ablexuelectrode-archetype-react-component-devmui-form-buildertix-react-ssrneutrino-preset-laima-webdszd-coredszd-mobilevue-hervue-cli-plugin-lodash@fpg-modules/fpg-ui-buildcomponent-slidercustom-react-scriptcj-scriptsdelta-design-system-webmwapi-helper-pluginquectel@morsedigital/webpack-defaults@morten.hogseth/bundlerxm-webpack-configzp-corezp-mobile@siteone/builder-corehandypack@skyrpex/starpack@o/buildgulp-frontend-toolsreact-gradient-picker@shopify/sewing-kit@shushu.pro/webpack@terraeclipse/crs-build@proerd/nextpress@nuofe/ndk-builderreact-app-rewire-lodash-pluginreach-et-webpack-setup@leomax/webpack@mingyuanyun/paas-scripts@minoris/sewing-kitreact-devpack@ozo/cra-rewiredreact-component-carousal@pandarose/webpackvue-cli-plugin-xmnr-r-snr-saga-appnr-thunk-appf6dwa.component.builderwa.builder3@fastweb/f2e-utilson-d-mand-react-app-rewire-lodash-pluginopenfe-spa-clifrack-build-config-factory@ifreeworld/webpack-configporseapipenet-toolsxq-serverxq-toolsxhcwxapp@mamba/webpackxn-admin-templategatsby-theme-sarvasyagatsby-theme-jason-bloggatsby-theme-bd-salonggatsby-plugin-lodashgatsby-docs-starter@mass-ui/sshellgatsby-plugin-offline-nextxyy-yuigatsby-starter-casper@starpack/starpackreact-ssr-boilerplate-2@trinitymirrordigital/webpack-config@trinitymirrordigital/webpack-setup
0.11.6

3 years ago

0.11.5

6 years ago

0.11.4

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.7

7 years ago

0.10.6

7 years ago

0.10.5

7 years ago

0.10.4

7 years ago

0.10.3

7 years ago

0.10.2

8 years ago

0.10.1

8 years ago

0.10.0

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago