# @excitare/require-fix-babel-plugin

> A plugin for allowing dynamic requires in Webpack processed code

Latest version **0.0.1-alpha.197** (published 2019-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @excitare/require-fix-babel-plugin
pnpm add @excitare/require-fix-babel-plugin
yarn add @excitare/require-fix-babel-plugin
bun add @excitare/require-fix-babel-plugin
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-alpha.197 |
| Published | 2019-10-16 |
| First published | 2018-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | eweilow |
| Maintainers | eweilow |
| Keywords | excitare |

## Links

- npm: https://www.npmjs.com/package/@excitare/require-fix-babel-plugin
- Repository: https://github.com/eweilow/excitare
- Issues: https://github.com/eweilow/excitare/issues
- npm.io page: https://npm.io/package/@excitare/require-fix-babel-plugin

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.0.1-alpha.197 (latest) — 2019-10-16
- 0.0.1-alpha.199 (next) — 2020-05-18
- 0.0.1-alpha.162 (experiment) — 2019-07-06
- 0.0.1-alpha.195 — 2019-09-14
- 0.0.1-alpha.190 — 2019-08-27
- 0.0.1-alpha.189 — 2019-08-19
- 0.0.1-alpha.175 — 2019-07-29
- 0.0.1-alpha.173 — 2019-07-21
- 0.0.1-alpha.172 — 2019-07-19
- 0.0.1-alpha.171 — 2019-07-19
- 0.0.1-alpha.170 — 2019-07-13
- 0.0.1-alpha.161 — 2019-07-04
- 0.0.1-alpha.154 — 2019-06-18
- 0.0.1-alpha.145 — 2019-05-01
- 0.0.1-alpha.142 — 2019-05-01
- … 21 more at https://npm.io/package/@excitare/require-fix-babel-plugin/versions

## README

# @excitare/require-fix-babel-plugin

[![npm (scoped)](https://img.shields.io/npm/v/@excitare/require-fix-babel-plugin.svg?style=for-the-badge)](https://www.npmjs.com/package/@excitare/require-fix-babel-plugin)

This package contains a Babel plugin for converting `require`-statements inside functions into Webpack-compatible `__non_webpack_require__` that is not compiled away during build-time.

This is required because Excitare builds [Next.js](https://github.com/zeit/next.js/) server code with Webpack and Next.js uses dynamic `require`-statements to load code for serverside rendering.

## Examples

The simplest example is:

```javascript
function test() {
  require("some require");
}
```

compiles to:

```javascript
function test() {
  __non_webpack_require__("some require");
}
```

The plugin doesn't touch require outside functions:

```javascript
require("some first require");

function test() {
  require("some require");
}
```

compiles to:

```javascript
require("some first require");

function test() {
  __non_webpack_require__("some require");
}
```

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