inject-loader

JSON →
library 4.0.1 ·javascript
verified May 27, 2026

A Webpack loader for injecting mock dependencies into modules under test. Current stable version 4.0.1, maintained steadily. It wraps all require statements in a module so you can substitute them during testing. Unlike proxyquire or rewire, it works as a Webpack inline loader, making it seamless in Webpack-based projects. Supports Webpack 1 through 4. Particularly useful for unit testing where you need to mock internal dependencies of a module before it executes.

total hits 24
actors 9 distinct systems
last hit 1d ago Amazonbot
ByteDance
6
MetaBot
4
GPTBot
2
Script
1
Amazonbot
1
Search engines
2
Humans
2

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇩🇪 Germany · 🇦🇹 Austria