# babel-plugin-transform-require-context

> [![NPM Downloads](https://img.shields.io/npm/dw/babel-plugin-transform-require-context)](https://npmjs.org/package/babel-plugin-transform-require-context)

Latest version **0.2.0** (published 2026-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-transform-require-context
pnpm add babel-plugin-transform-require-context
yarn add babel-plugin-transform-require-context
bun add babel-plugin-transform-require-context
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated.

Warnings: low downloads; no types; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-07-22 |
| First published | 2018-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Aliaksei Sapach |
| Maintainers | asapach |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-transform-require-context
- Repository: https://github.com/asapach/babel-plugin-transform-require-context
- Homepage: https://github.com/asapach/babel-plugin-transform-require-context#readme
- Issues: https://github.com/asapach/babel-plugin-transform-require-context/issues
- npm.io page: https://npm.io/package/babel-plugin-transform-require-context

## Recent versions

- 0.2.0 (latest) — 2026-07-22
- 0.1.1 — 2018-12-13
- 0.0.3 — 2018-04-20
- 0.0.2 — 2018-04-20
- 0.0.1 — 2018-04-12

## README

# babel-plugin-transform-require-context

[![NPM Downloads](https://img.shields.io/npm/dw/babel-plugin-transform-require-context)](https://npmjs.org/package/babel-plugin-transform-require-context)

A [Babel](http://babeljs.io) plugin that transforms [webpack](https://webpack.js.org/)-specific `require.context()`
into dummy function calls so that the code can run safely outside of the webpack environment, e.g. in Node.
It doesn't perform any file lookup or dynamic require, but should not break the code otherwise.

## Installation

```sh
$ npm install babel-plugin-transform-require-context
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```javascript
{
  "plugins": ["transform-require-context"]
}
```

### Via CLI

```sh
$ babel --plugins transform-require-context script.js
```

### Via Node API

```javascript
require("@babel/core").transform("code", {
  plugins: ["transform-require-context"]
});
```

---
_Source: https://npm.io/package/babel-plugin-transform-require-context · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
