
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@tinkoff/babel-plugin-lodash
Advanced tools
Transform lodash imports to include into bundle only imported functions
This plugin transforms lodash imports to include into bundle only imported functions.
npm install --save-dev @tinkoff/babel-plugin-lodash
yarn add --dev @tinkoff/babel-plugin-lodash
In
import _ from "lodash";
import { add } from "lodash/fp";
import { slice } from "lodash-es";
const addOne = add(1);
_.map([1, 2, 3], addOne);
slice([1, 2, 3], 2);
Out
import _add from "lodash/fp/add";
import _map from "lodash/map";
import _slice from "lodash-es/slice";
const addOne = _add(1);
_map([1, 2, 3], addOne);
_slice([1, 2, 3], 2);
.babelrc
{
"plugins": ["@tinkoff/babel-plugin-lodash"]
}
$ babel --plugins @tinkoff/babel-plugin-lodash script.js
require("@babel/core").transformSync(code, {
plugins: ["@tinkoff/babel-plugin-lodash"],
});
ensureModuleExists
boolean
, defaults to false
.
When this option is enabled, plugin tries to resolve path to imported lodash module using require.resolve()
. If the
module can not be found, an error is thrown. Usually such check is done out of box by bundler (e.g. webpack) or
typescript. Enabling this option may lead to decreasing performance.
In
import _ from "lodash";
_.slice([1, 2], 1);
_.unknownFunc();
Out
import _slice from "lodash/slice"; // OK
import _unknownFunc from "lodash/unknownFunc"; // ERROR
_slice([1, 2], 1);
_unknownFunc();
lodash
, lodash/fp
, lodash-es
FAQs
Transform lodash imports to include into bundle only imported functions
The npm package @tinkoff/babel-plugin-lodash receives a total of 81 weekly downloads. As such, @tinkoff/babel-plugin-lodash popularity was classified as not popular.
We found that @tinkoff/babel-plugin-lodash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 17 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
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.