Search npm modules search

lodash-webpack-plugin @0.10.7

Smaller modular Lodash builds.

Share this code:


lodash-webpack-plugin v0.10.7

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!


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



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)_:

shorthandsIteratee shorthands for, _.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)_


  • licenseMIT