Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
esbuild-plugin-lodash
Advanced tools
This plugin is for esbuild, similar to how babel-plugin-lodash works for babel.
The non-es lodash
package is not tree-shakeable, this plugin is only for direct import workaround.
For better coding practices, you can use instead lodash-es
directly or strictly import the required lodash function manually.
npm install --save-dev esbuild-plugin-lodash
Define plugin in the plugins
section of esbuild config like this:
const esbuild = require('esbuild');
const lodashTransformer = require('esbuild-plugin-lodash');
esbuild.build({
// ...
plugins: [
lodashTransformer(),
],
})
Having this input file:
import { get, isEmpty } from 'lodash';
const something = {};
get(something);
isEmpty(something);
It will output this following file content:
import get from 'lodash/get';
import isEmpty from 'lodash/isEmpty';
const something = {};
get(something);
isEmpty(something);
You can specify your own filter
as per according to esbuild docs here.
You can specify outLodashPackage
which by default is lodash
. An example
of this would be specifying calls to be rewritten to use lodash-es
.
FAQs
Similar babel-plugin-lodash for esbuild
We found that esbuild-plugin-lodash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.