Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Smaller modular Lodash builds.

License

NotificationsYou must be signed in to change notification settings

lodash/lodash-webpack-plugin

Repository files navigation

Create smaller Lodash builds by replacingfeature sets of moduleswithnoop,identity,or simpler alternatives.

This plugin complementsbabel-plugin-lodashby 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
varLodashModuleReplacementPlugin=require('lodash-webpack-plugin');varwebpack=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':[newLodashModuleReplacementPlugin,newwebpack.optimize.UglifyJsPlugin]};

Opt-in to features with an options object:

newLodashModuleReplacementPlugin({'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.
(requirescurrying)
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.
(requirescurrying)

About

Smaller modular Lodash builds.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors12


[8]ページ先頭

©2009-2025 Movatter.jp