0.11.6 • Published 5 years ago

lodash-webpack-plugin v0.11.6

Weekly downloads
219,253
License
MIT
Repository
github
Last release
5 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-lodashblomjoyent-react-scriptsjson-cubeskilldata-componenticlickimt-cligulp-frontend-toolshookedjshandypacklichenlearning-builder-webpackleomax-webpackmacross-bundlermaxt-scripts@wicked_query/ultimatejs@westegg/city-limits@westegg/core@uidu/webpack-config@tiket-com/react-script@terraeclipse/crs-build@trinitymirrordigital/webpack-config@trinitymirrordigital/webpack-setup@vtex/react-scripts@zalastax/nolb-lodaandari-webpack@zohodesk/react-cliaext-scriptsabc-clia8kactive-switchingameinfo-helper-pluginaxis-react-scriptsauspiceauspice-revseqanurag-react-scriptsarctic-eventsappcloud-componentappbase-onboardingapp-cwk@go1/react-setup@goodforonefare/sewing-kit@goodforonefare/sewing-kitten@guhongjie/admin-cli-test@guhongjie/cli-vue2@hackoregon/webpack-common@hasaki-ui/hsk-garen@starpack/starpackrecceumi-plugin-bundle-compresstix-react-ssryetoolygh-websiteyui-scaffoldxyy-yuixn-admin-templatexq-serverxq-toolszp-mobilezp-corewebpackerwebpack-cutewebpack-config-nodewebpack-config-lagwebpack-multipurpose-builderwebui_cswebpack-preset-unity@infinitebrahmanuniverse/nolb-loda@laihua/webui@leomax/webpack
0.11.6

5 years ago

0.11.5

8 years ago

0.11.4

8 years ago

0.11.3

9 years ago

0.11.2

9 years ago

0.11.1

9 years ago

0.11.0

9 years ago

0.10.7

9 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

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago