Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jaydenseric/babel-plugin-transform-runtime-file-extensions
- Owner: jaydenseric
- Created: 2020-04-06T05:00:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-05T03:08:42.000Z (over 4 years ago)
- Last Synced: 2024-04-26T04:20:21.324Z (8 months ago)
- Topics: babel, esm, node
- Language: JavaScript
- Size: 11.7 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Funding: .github/funding.yml
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"]
}
```