
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
lodash-webpack-plugin
Advanced tools
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.
$ npm i --save lodash
$ npm i --save-dev lodash-webpack-plugin babel-core babel-loader babel-plugin-lodash babel-preset-env webpack
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
});
The following features are removed by default (biggest savings first):
Feature | Description |
---|---|
shorthands | Iteratee shorthands for _.property , _.matches , & _.matchesProperty . |
cloning | Support “clone” methods & cloning source objects. |
currying | Support “curry” methods. |
caching | Caches for methods like _.cloneDeep , _.isEqual , & _.uniq . |
collections | Support objects in “Collection” methods. |
exotics | Support objects like buffers, maps, sets, symbols, typed arrays, etc. |
guards | Guards for host objects, sparse arrays, & other edge cases. |
metadata | Metadata to reduce wrapping of bound, curried, & partially applied functions. (requires currying ) |
deburring | Support deburring letters. |
unicode | Support Unicode symbols. |
chaining | Components to support chain sequences. |
memoizing | Support _.memoize & memoization. |
coercions | Support for coercing values to integers, numbers, & strings. |
flattening | Support “flatten” methods & flattening rest arguments. |
paths | Deep property path support for methods like _.get , _.has , & _.set . |
placeholders | Argument placeholder support for “bind”, “curry”, & “partial” methods. (requires currying ) |
FAQs
Smaller modular Lodash builds.
The npm package lodash-webpack-plugin receives a total of 78,473 weekly downloads. As such, lodash-webpack-plugin popularity was classified as popular.
We found that lodash-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.