Skip to content

Commit e2a296e

Browse files
committed
Doc update: include "Usage with esm"
- Closes #99
1 parent 44d4cbb commit e2a296e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ Unfortunately, `module-alias` itself would not work from Jest due to a custom be
160160

161161
More details on the [official documentation](https://jestjs.io/docs/en/configuration#modulenamemapper-objectstring-string).
162162

163+
## Usage with esm
164+
165+
[esm](https://www.npmjs.com/package/esm) tries to handle all imports when parsing a file, before actually loading any module. This means module-alias' `register` call will not be processed in time. To make `module-alias` work with `esm`, please consider using:
166+
167+
```
168+
node -r module-alias/register -r esm index.js
169+
```
170+
163171
## Known incompatibilities
164172

165173
This module does not play well with:

0 commit comments

Comments
 (0)