Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaydenseric/babel-plugin-transform-runtime-file-extensions

A Babel plugin that adds file extensions to Babel runtime import specifiers and require paths for Node.js ESM compatibility.
https://github.com/jaydenseric/babel-plugin-transform-runtime-file-extensions

babel esm node

Last synced: 2 months ago
JSON representation

A Babel plugin that adds file extensions to Babel runtime import specifiers and require paths for Node.js ESM compatibility.

Awesome Lists containing this project

README

        

# babel-plugin-transform-runtime-file-extensions

[![npm version](https://badgen.net/npm/v/babel-plugin-transform-runtime-file-extensions)](https://npm.im/babel-plugin-transform-runtime-file-extensions) [![CI status](https://github.com/jaydenseric/babel-plugin-transform-runtime-file-extensions/workflows/CI/badge.svg)](https://github.com/jaydenseric/babel-plugin-transform-runtime-file-extensions/actions)

A [Babel](https://babeljs.io) plugin that adds file extensions to Babel runtime `import` specifiers and `require` paths for [Node.js ESM compatibility](https://nodejs.org/api/esm.html#esm_mandatory_file_extensions).

This is a temporary workaround for [babel/babel#8462](https://github.com/babel/babel/issues/8462).

## Setup

To install from [npm](https://npmjs.com) run:

```sh
npm install babel-plugin-transform-runtime-file-extensions --save-dev
```

Configure Babel to use the plugin, after [`@babel/plugin-transform-runtime`](https://npm.im/@babel/plugin-transform-runtime):

```json
{
"plugins": ["@babel/transform-runtime", "transform-runtime-file-extensions"]
}
```