babel-plugin-rewire
JSON →A Babel plugin that adds __Rewire__, __ResetDependency__, and __GetDependency__ methods to modules for mocking dependencies in tests. Version 1.2.0 is stable with moderate release cadence. It supports ES6 import, CommonJS require(), and top-level variable/function rewiring. Unlike proxyquire or rewire.js, it works at the AST level via Babel, enabling rewiring of named exports and internal dependencies. Supports both default and named exports, and automatically handles primitive vs object default exports. Compatible with React and other transpiled environments.
Traffic · last 30 days stale · no recent hits
total hits 19
actors 4 distinct systems
last hit 18d ago ByteDance
top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · MM
Resources
API endpoints
full doc /v1/registry/babel-plugin-rewire
compatibility /v1/registry/babel-plugin-rewire/compatibility