Registry / devops / ep-rdi

ep-rdi

JSON →
library0.0.0jsnpmunverified

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.

npm install ep-rdi
INSTALL
IMPORT
SIG · EP-RDI
E
ep-rdi
devopsjavascriptv0.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rdiPlugin
import { rdiPlugin } from 'esbuild-plugin-rdi'
const rdiPlugin = require('esbuild-plugin-rdi')
Package is ESM-only; use ES import syntax.
default
import rdiPlugin from 'esbuild-plugin-rdi'
const rdiPlugin = require('esbuild-plugin-rdi')
Default export is also available, but named export is preferred.
PluginOptions
import type { PluginOptions } from 'esbuild-plugin-rdi'
Type-only import for TypeScript. PluginOptions type is exported.

Shows how to use the plugin with esbuild to minify and remove duplicate requires from a bundle.

import { rdiPlugin } from 'esbuild-plugin-rdi'; import * as esbuild from 'esbuild'; await esbuild.build({ entryPoints: ['src/index.ts'], outfile: 'dist/bundle.js', bundle: true, minify: true, format: 'cjs', plugins: [rdiPlugin()] });
Debug
Known issues
gotchaPlugin only works with CJS output format; does not affect ESM builds.
fix
Ensure esbuild format is 'cjs'.
affects: 0.0.0
gotchaPlugin may remove require statements that are not truly duplicates if they have different runtime effects.
fix
Manually verify that removed requires are safe.
affects: 0.0.0
deprecatedPackage name 'ep-rdi' is deprecated; use 'esbuild-plugin-rdi' instead.
fix
Update npm package name to 'esbuild-plugin-rdi'.
affects: 0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-plugin-rdi'
Package installed under deprecated name 'ep-rdi' or not installed at all.
fix
Install with correct name: npm install esbuild-plugin-rdi
SyntaxError: Named export 'rdiPlugin' not found
Trying to use require() instead of import.
fix
Use ES module import syntax: import { rdiPlugin } from 'esbuild-plugin-rdi'
TypeError: rdiPlugin is not a function
Forgetting to invoke rdiPlugin() in plugins array.
fix
Use it as rdiPlugin() not just rdiPlugin
Upgrade
Version history
0.0.0latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency - plugin integrates with esbuild
Agent activity
4 hits · last 30 days
node
4
Resources
ep-rdi — npm install ep-rdi · libregistry