Skip to content

Commit 28adc6a

Browse files
committed
fixup! doc: edit import.meta.resolve documentation
1 parent fa5e535 commit 28adc6a

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

doc/api/esm.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,20 @@ import.meta.resolve('./dep');
366366
All features of the Node.js module resolution are supported. Dependency
367367
resolutions are subject to the permitted exports resolutions within the package.
368368
369-
> **Caveat** This can result in synchronous file-system operations, which
370-
> can impact performance similarly to `require.resolve`. This feature is not
371-
> available within custom loaders (it would create a deadlock).
369+
**Caveats**:
372370
373-
Previously, Node.js implemented an asynchronous resolver which also permitted
374-
a second contextual argument. The implementation has since been updated to be
375-
synchronous, with the second contextual `parent` argument still accessible
376-
behind the `--experimental-import-meta-resolve` flag:
371+
* This can result in synchronous file-system operations, which
372+
can impact performance similarly to `require.resolve`.
373+
* This feature is not available within custom loaders (it would
374+
create a deadlock).
375+
376+
**Non-standard API**:
377+
378+
When using the `--experimental-import-meta-resolve` flag, that function accepts
379+
a second argument:
377380
378381
* `parent` {string|URL} An optional absolute parent module URL to resolve from.
382+
**Default:** `import.meta.url`
379383
380384
## Interoperability with CommonJS
381385

0 commit comments

Comments
 (0)