babel-plugin-rewire-ts

JSON →
library 1.4.0 ·javascript maintenance
verified May 27, 2026

A Babel plugin that enables mocking of module dependencies for testing, based on the rewire.js concept. The current stable version is 1.4.0, with a release cadence that is maintenance-focused. It is a fork of babel-plugin-rewire with added TypeScript compatibility. Key differentiators: it works with TypeScript, supports ES6 imports, CommonJS require(), and named/top-level function rewiring. It provides a RewireAPI object for convenient mocking in tests. It is specifically designed for unit testing where module dependencies need to be replaced with mocks or stubs.

total hits 25
actors 8 distinct systems
last hit 2d ago AhrefsBot
Amazonbot
4
MetaBot
4
ByteDance
3
GPTBot
2
Script
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇸🇬 Singapore · 🇫🇷 France · 🇨🇦 Canada