# babel-plugin-dynamic-import-to-require

> Babel plugin to transpile import() to require()

Latest version **0.1.1** (published 2018-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-dynamic-import-to-require
pnpm add babel-plugin-dynamic-import-to-require
yarn add babel-plugin-dynamic-import-to-require
bun add babel-plugin-dynamic-import-to-require
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-05-11 |
| First published | 2018-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 574 |
| Author | Jordan Gensler |
| Maintainers | ramesaliyev |
| Keywords | babel, plugin, dynamic, import, node |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-dynamic-import-to-require
- Repository: https://github.com/airbnb/babel-plugin-dynamic-import-node
- Homepage: https://github.com/airbnb/babel-plugin-dynamic-import-node#readme
- Issues: https://github.com/airbnb/babel-plugin-dynamic-import-node/issues
- npm.io page: https://npm.io/package/babel-plugin-dynamic-import-to-require

## Dependencies (1)

- [babel-plugin-syntax-dynamic-import](https://npm.io/package/babel-plugin-syntax-dynamic-import.md) ^6.18.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2018-05-11
- 0.1.0 — 2018-05-03

## README

# babel-plugin-dynamic-import-to-require

Well.. It seemed like a good idea at the beginning, but turned out it is not. Didn't solve my problem as well. But since i did it, it will stay here.

Babel plugin to transpile `import()` to `require()`, for node.

**NOTE:** Babylon >= v6.12.0 is required to correct parse dynamic imports.

## Installation

```sh
$ npm install babel-plugin-dynamic-import-to-require --save-dev
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "plugins": ["dynamic-import-to-require"]
}
```

### Via CLI

```sh
$ babel --plugins dynamic-import-to-require script.js
```

### Via Node API

```javascript
require('babel-core').transform('code', {
  plugins: ['dynamic-import-to-require']
});
```

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