0.11.6 • Published 4 years ago

lodash-webpack-plugin v0.11.6

Weekly downloads
219,253
License
MIT
Repository
github
Last release
4 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)
xdf-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-2094test-ehome-template1wa.builder3wa.component.builderweauthweb-minecraft-forkvue-hervue-cli-plugin-xmwebcubeworona-packagesxams-clixm-webpack-configxhcwxappthis-is-a-uivantbase-ablexuvue-cli-plugin-lodash@djforth/webpacksetup-middleman@coco-platform/webpack@ctsx/webpack@dallin343/chisel-cms@conglomerate/weaver@doop/core-vue@rubik-ui/hjlblomjoyent-react-scriptsjson-cubeskilldata-component@starpack/starpackrecceumi-plugin-bundle-compresstix-react-ssr@amilajack/skill-lodash@average-gate/bundler@baic/yolk-miniapp@beisen/bsapp-mobile-complex-ui@beisen/bsapp-buildcore@beisen/bsapp-core@beisen/bsapp-core-tita@bapp-open/react-scripts@bjerra/gatsby-theme-bd-salong@bringhub/webpack-config-package@chr.fritsch/gatsby-theme-blog@104corp/espack@boldr/plugin-webpack@ddeis/ngjs-scripts@deboxsoft/devel-webappyetoolygh-websiteyui-scaffoldxyy-yuixn-admin-templatexq-serverxq-toolszp-mobilezp-corewebpackerwebpack-cutewebpack-config-nodewebpack-config-lagwebpack-multipurpose-builderwebui_cswebpack-preset-unity@danproudfeet/react-scripts@fastweb/f2e-utils@hasaki-ui/hsk-garen@guhongjie/admin-cli-test@guhongjie/cli-vue2@hackoregon/webpack-common@heisea/err-log@heisea/viewer@heisea/affix@hejk/affix@hejk/fetch@fpg-modules/fpg-ui-build@elumeo/jfs-core@elumeo/jfs-core-dev@gcdtech/propertynews-react-scripts@goodforonefare/sewing-kit@goodforonefare/sewing-kitten@go1/react-setup@infinitebrahmanuniverse/nolb-loda@laihua/webui@leomax/webpack@mypaas/paas-dev-tools@mass-ui/sshell
0.11.6

4 years ago

0.11.5

7 years ago

0.11.4

8 years ago

0.11.3

8 years ago

0.11.2

8 years ago

0.11.1

8 years ago

0.11.0

8 years ago

0.10.7

8 years ago

0.10.6

9 years ago

0.10.5

9 years ago

0.10.4

9 years ago

0.10.3

9 years ago

0.10.2

9 years ago

0.10.1

9 years ago

0.10.0

9 years ago

0.9.4

9 years ago

0.9.3

9 years ago

0.9.2

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago

0.8.2

9 years ago

0.8.1

9 years ago

0.8.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago