Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing es-toolkit-webpack-plugin: Webpack 5 plugin for replacing lodash with es-toolkit #758

Open
D-Sketon opened this issue Oct 26, 2024 · 0 comments

Comments

@D-Sketon
Copy link
Contributor

D-Sketon commented Oct 26, 2024

I was inspired by #593 to develop a similar webpack 5 plugin for replacing lodash with es-toolkit!😍😍

https://github.com/D-Sketon/es-toolkit-webpack-plugin

Usage

npm install es-toolkit
npm install es-toolkit-webpack-plugin --save-dev
// webpack.config.js
const WebpackEsToolkitPlugin = require("es-toolkit-webpack-plugin");

module.exports = {
  plugins: [new WebpackEsToolkitPlugin.default({
    excludes: ["isEqual"],
  })],
};


// webpack.config.mjs
import WebpackEsToolkitPlugin from "es-toolkit-webpack-plugin";
export default {
  plugins: [new WebpackEsToolkitPlugin({
    excludes: ["isEqual"],
  })],
};

Supported situations

// lodash
import _ from "lodash"; // supported
import { debounce, isEqual } from "lodash"; // supported
import { debounce as _debounce } from "lodash"; // supported
import lodashIsEqual from "lodash/isEqual.js"; // supported
import _, { debounce, isEqual } from "lodash"; // supported
const _ = require("lodash"); // supported
const isEqual = require("lodash/isEqual.js"); // supported

// lodash-es
import _ from "lodash-es"; // supported
import { debounce, isEqual } from "lodash-es"; // supported
import { debounce as _debounce } from "lodash-es"; // supported
import lodashIsEqual from "lodash-es/isEqual.js"; // supported
import _, { debounce, isEqual } from "lodash-es"; // supported
const _ = require("lodash-es"); // supported
const isEqual = require("lodash-es/isEqual.js"); // supported

// lodash.*
import lodashIsEqual from "lodash.isequal"; // supported
const lodashIsEqual = require("lodash.isequal"); // supported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant