{"id":25232,"library":"ep-rdi","title":"esbuild-plugin-rdi","description":"An esbuild plugin that removes duplicate require statements from minified builds, reducing bundle size by eliminating redundant module imports. Version 0.0.0 is the initial release. It integrates seamlessly with esbuild and tsup, supporting TypeScript out of the box. Key differentiator: focuses specifically on duplicate require removal in esbuild, filling a niche gap in build optimization. Development is active with no breaking changes yet.","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 ep-rdi","lang":"bash","label":"npm"},{"cmd":"yarn add ep-rdi","lang":"bash","label":"yarn"},{"cmd":"pnpm add ep-rdi","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - plugin integrates with esbuild","package":"esbuild","optional":false}],"imports":[{"note":"Package is ESM-only; use ES import syntax.","wrong":"const rdiPlugin = require('esbuild-plugin-rdi')","symbol":"rdiPlugin","correct":"import { rdiPlugin } from 'esbuild-plugin-rdi'"},{"note":"Default export is also available, but named export is preferred.","wrong":"const rdiPlugin = require('esbuild-plugin-rdi')","symbol":"default","correct":"import rdiPlugin from 'esbuild-plugin-rdi'"},{"note":"Type-only import for TypeScript. PluginOptions type is exported.","wrong":"","symbol":"PluginOptions","correct":"import type { PluginOptions } from 'esbuild-plugin-rdi'"}],"quickstart":{"code":"import { rdiPlugin } from 'esbuild-plugin-rdi';\nimport * as esbuild from 'esbuild';\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  outfile: 'dist/bundle.js',\n  bundle: true,\n  minify: true,\n  format: 'cjs',\n  plugins: [rdiPlugin()]\n});","lang":"typescript","description":"Shows how to use the plugin with esbuild to minify and remove duplicate requires from a bundle."},"warnings":[{"fix":"Ensure esbuild format is 'cjs'.","message":"Plugin only works with CJS output format; does not affect ESM builds.","severity":"gotcha","affected_versions":"0.0.0"},{"fix":"Manually verify that removed requires are safe.","message":"Plugin may remove require statements that are not truly duplicates if they have different runtime effects.","severity":"gotcha","affected_versions":"0.0.0"},{"fix":"Update npm package name to 'esbuild-plugin-rdi'.","message":"Package name 'ep-rdi' is deprecated; use 'esbuild-plugin-rdi' instead.","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":"Install with correct name: npm install esbuild-plugin-rdi","cause":"Package installed under deprecated name 'ep-rdi' or not installed at all.","error":"Error: Cannot find module 'esbuild-plugin-rdi'"},{"fix":"Use ES module import syntax: import { rdiPlugin } from 'esbuild-plugin-rdi'","cause":"Trying to use require() instead of import.","error":"SyntaxError: Named export 'rdiPlugin' not found"},{"fix":"Use it as rdiPlugin() not just rdiPlugin","cause":"Forgetting to invoke rdiPlugin() in plugins array.","error":"TypeError: rdiPlugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}