@0x706b/ts-transform-fix-esm
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

ts-transform-fix-esm

Disclaimer

This transformer is experimental; use it at your own risk.

Description

Adds file extension and/or index to module specifiers and correctly requires commonjs modules in an ESM environment.

For example:

import { thing } from "commonjs/file";
import { anotherThing } from "esm/folder"

becomes

import { anotherThing } from "esm/folder/index.js";
import { createRequire as __createRequire } from "module";
const __require = __createRequire(import.meta.url);
const { thing } = require(commonjs/file);

Readme

Keywords

none

Package Sidebar

Install

npm i @0x706b/ts-transform-fix-esm

Weekly Downloads

2

Version

0.2.2

License

MIT

Unpacked Size

40 kB

Total Files

14

Last publish

Collaborators

  • 0x706b