Registry / devops / vite-plugin-es-toolkit

vite-plugin-es-toolkit

JSON →
library1.1.0jsnpmunverified

A Vite plugin that automatically replaces Lodash imports with es-toolkit equivalents during the build process. Current stable version is 1.1.0, maintained actively with support for Vite 2.3 to 8.x. Key differentiators: no manual code changes required, supports all import patterns (named, default, star, deep paths including .js extensions), and handles renaming. Alternative to manual migration scripts; integrates seamlessly into existing Vite projects using Lodash.

npm install vite-plugin-es-toolkit
INSTALL
IMPORT
SIG · VITE-PLUGIN-ES-TOO
V
vite-plugin-es-toolkit
devopsjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import esToolkitPlugin from 'vite-plugin-es-toolkit'
const esToolkitPlugin = require('vite-plugin-es-toolkit')
ESM-only package; CommonJS require() will fail
esToolkitPlugin
import esToolkitPlugin from 'vite-plugin-es-toolkit'
Default export is the plugin function
createPlugin
import { createPlugin } from 'vite-plugin-es-toolkit'
import createPlugin from 'vite-plugin-es-toolkit'
Named export available since v1.0.0 for advanced use

Installs and configures the plugin to replace Lodash with es-toolkit in a Vite project.

// vite.config.js import { defineConfig } from 'vite'; import esToolkitPlugin from 'vite-plugin-es-toolkit'; export default defineConfig({ plugins: [ esToolkitPlugin(), ], });
Debug
Known issues
breakingVersion 1.0.0 requires Vite >=5.0.0. Older Vite versions are not supported.
fix
Upgrade to Vite 5+ or use vite-plugin-es-toolkit@0.x with Vite 4.
affects: >=1.0.0 <1.1.0
breakingThe plugin only works with ESM imports. Any CommonJS require() of Lodash will not be transformed.
fix
Convert require() to import statements in your source files.
affects: >=0.1.0
gotchaThe plugin assumes es-toolkit has an equivalent for every Lodash function used. If a function is missing, your build may break or silently keep the original import.
fix
Check es-toolkit's coverage; consider fallback lodash imports or manual replacement for missing functions.
affects: >=0.1.0
deprecatedSupport for Vite 5 is deprecated; future versions will require Vite 6+.
fix
Upgrade to Vite 6 or later to ensure compatibility.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'vite-plugin-es-toolkit'
Package not installed or not in node_modules.
fix
Run `npm install vite-plugin-es-toolkit --save-dev`
TypeError: vitePluginEsToolkit is not a function
Using the plugin incorrectly as a configuration object instead of calling it.
fix
Use `esToolkitPlugin()` (with parentheses) in the plugins array.
Error: The plugin does not support CommonJS imports. Use ESM import instead.
Using require() to import the plugin itself or trying to transform require() calls.
fix
Use `import esToolkitPlugin from 'vite-plugin-es-toolkit'` and ensure all Lodash imports are ESM.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
es-toolkitrequiredPeer dependency; provides the replacement utility functions
viterequiredPeer dependency; the plugin requires Vite as the build tool
Agent activity
10 hits · last 30 days
node
10
Resources
vite-plugin-es-toolkit — npm install vite-plugin-es-toolkit · libregistry