Preparing for system design interviews?  Try bugzed.com →

Babel Plugin Require Context Hook

JSON →
library 1.0.0 ·javascript
verified Jun 17, 2026

A Babel plugin that replicates Webpack's require.context() for use in Node.js environments, primarily with Mocha tests or scripts. Current stable version 1.0.0. It rewrites require.context calls into a global function provided by a helper register script. Unlike alternatives (e.g., mock-require-context), this plugin uses a Babel transform to inject __dirname into the context, making it work seamlessly with babel-register. It has no runtime dependencies.

total hits 17
actors 4 distinct systems
last hit 20d ago AhrefsBot
GPTBot
4
ByteDance
4
Script
1
Humans
4

top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇨🇦 Canada · MY · VN