https://github.com/react18-tools/esbuild-plugin-remove-duplicate-imports
ESBuild plugin to remove duplicate import and require statements from the minified build.
https://github.com/react18-tools/esbuild-plugin-remove-duplicate-imports
Last synced: 10 months ago
JSON representation
ESBuild plugin to remove duplicate import and require statements from the minified build.
- Host: GitHub
- URL: https://github.com/react18-tools/esbuild-plugin-remove-duplicate-imports
- Owner: react18-tools
- License: mpl-2.0
- Created: 2024-06-19T13:41:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-22T02:23:23.000Z (10 months ago)
- Last Synced: 2025-07-22T04:25:52.578Z (10 months ago)
- Language: JavaScript
- Size: 3.5 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Esbuild Plugin Remove Duplicate Imports 
[](https://github.com/react18-tools/esbuild-plugin-remove-duplicate-require/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/esbuild-plugin-remove-duplicate-require/maintainability) [](https://codecov.io/gh/react18-tools/esbuild-plugin-remove-duplicate-require) [](https://www.npmjs.com/package/esbuild-plugin-rdi) [](https://www.npmjs.com/package/esbuild-plugin-rdi)  [](https://gitpod.io/from-referrer/)
> ESBuild plugin to remove duplicate require statements from minified build.
>
Please consider starring [this repository](https://github.com/react18-tools/esbuild-plugin-remove-duplicate-require) and sharing it with your friends.
## Getting Started
### Installation
```bash
$ pnpm add esbuild-plugin-rdi
```
**_or_**
```bash
$ npm install esbuild-plugin-rdi
```
**_or_**
```bash
$ yarn add esbuild-plugin-rdi
```
> If you are using `monorepo` or `workspaces`, you can install this plugin to the root using `-w` or to a specific workspace using `--filter your-package` or `--scope your-package` for `pnpm` or `yarn` workspaces, respectively.
## Use with `tsup`
```ts
// tsup.config.ts or tsup.config.js
import { defineConfig } from "tsup";
import { rdiPlugin } from "esbuild-plugin-rdi";
export default defineConfig(options => ({
...
esbuildPlugins:[rdiPlugin()]
}));
```
## Use with `esbuild`
```ts
import { rdiPlugin } from "esbuild-plugin-rdi";
esbuild.build({
...
plugins: [rdiPlugin()],
});
```
## Plugin Options
Coming soon...
### [🤩 Don't forget to star this repo!](https://github.com/react18-tools/esbuild-plugin-remove-duplicate-require)
>
Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsoring](https://github.com/sponsors/mayank1513) our work.

## License
This library is licensed under the MPL-2.0 open-source license.
with 💖 by Mayank Kumar Chaudhari