Skip to content

Commit

Permalink
docs: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gjbkz committed May 5, 2022
1 parent 716dae4 commit 5d83094
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@

A command line tool converts tsc output to ESM modules.

## What does it do?

Assume you have file1.js and file2.js.

```javascript
// file1.js
import {v2} from './file2';
const f2 = import('./file2');

// file2.js
import {external} from '../extenal/file';
import {v1} from './file1';
const f1 = import('./file1');
```

esmify renames `*.js` to `*.mjs` and disambiguates import sources in the code.

```javascript
// file1.mjs
import {v2} from './file2.mjs';
const f2 = import('./file2.mjs');

// file2.mjs
import {external} from '../extenal/file.js';
import {v1} from './file1.mjs';
const f1 = import('./file1.mjs');
```

## Usage

```
Expand Down

0 comments on commit 5d83094

Please sign in to comment.