Vite plugin for replacing Lodash with es-toolkit, a smaller, faster, and more tree-shakable alternative.
- Install es-toolkit, if you haven't already, by executing
npm install es-toolkit
oryarn add es-toolkit
. - Install by executing
npm install vite-plugin-es-toolkit
oryarn add vite-plugin-es-toolkit
. - Import by adding
import esToolkitPlugin from 'vite-plugin-es-toolkit'
. - Use it by adding
esToolkitPlugin()
toplugins
section of your Vite config.
Here's an example of basic configuration:
import { defineConfig } from 'vite';
import esToolkitPlugin from 'vite-plugin-es-toolkit';
export default defineConfig({
plugins: [
esToolkitPlugin(),
],
});
Tip
Measure actual impact of vite-plugin-es-toolkit
on your codebase with Vite Compare Bundle Size GitHub Action.
The MIT License.
Wojciech Maj |