{"id":25400,"library":"esbuild-plugin-remove-multiple-require","title":"esbuild-plugin-remove-duplicate-require","description":"ESBuild plugin that removes duplicate require statements from minified builds, reducing bundle size. Version 0.0.0 is the initial release. It works by detecting and deduplicating repeated require() calls in the output, which can occur when multiple modules import the same dependency. Different from many plugins, it focuses specifically on the final bundle output rather than during tree-shaking. Ships TypeScript types.","status":"active","version":"0.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/react18-tools/esbuild-plugin-remove-duplicate-require","tags":["javascript","React 18","React 19","Next.js","Next.js 14","Next.js 15","React server components","Customizable","Cutting-edge","typescript"],"install":[{"cmd":"npm install esbuild-plugin-remove-multiple-require","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-remove-multiple-require","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-remove-multiple-require","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default export not available; must use named import.","wrong":"import rdiPlugin from 'esbuild-plugin-rdi'","symbol":"rdiPlugin","correct":"import { rdiPlugin } from 'esbuild-plugin-rdi'"},{"note":"CommonJS: destructure the required object to get the named export.","wrong":"const rdiPlugin = require('esbuild-plugin-rdi')","symbol":"rdiPlugin","correct":"const { rdiPlugin } = require('esbuild-plugin-rdi')"},{"note":"TypeScript only: plugin options type may be available as named export; use type import for runtime elimination.","wrong":"import { RdiOptions } from 'esbuild-plugin-rdi'","symbol":"type imports","correct":"import type { RdiOptions } from 'esbuild-plugin-rdi'"}],"quickstart":{"code":"import { rdiPlugin } from 'esbuild-plugin-rdi';\nimport * as esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['app.ts'],\n  bundle: true,\n  outfile: 'out.js',\n  plugins: [rdiPlugin()],\n});","lang":"typescript","description":"Uses rdiPlugin in an esbuild build to remove duplicate require statements from the bundled output."},"warnings":[{"fix":"Place rdiPlugin last in the plugins array.","message":"Plugin modifies the final bundle after minification; ensure it runs after other plugins that might introduce duplicates.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install as 'esbuild-plugin-rdi'. Import from 'esbuild-plugin-rdi'.","message":"The package name in npm is 'esbuild-plugin-rdi' not 'esbuild-plugin-remove-multiple-require'.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install esbuild-plugin-rdi","cause":"Wrong package name used.","error":"Error: Cannot find module 'esbuild-plugin-remove-duplicate-require'"},{"fix":"import { rdiPlugin } from 'esbuild-plugin-rdi'","cause":"Default import used instead of named import.","error":"TypeError: rdiPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}