Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9833dc6

Browse filesBrowse files
meteorqz6aduh95
authored andcommitted
doc: rephrase dynamic import() description
The description is updated to clarify that dynamic import() is asynchronous, dynamic, and works in both CJS and ESM contexts. The new phrasing also avoids implying it is the only method for loading ES modules in CommonJS. Fixes: #59077 PR-URL: #59224 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent bb6fd7c commit 9833dc6
Copy full SHA for 9833dc6

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ fs.readFileSync === readFileSync;
331331

332332
## `import()` expressions
333333

334-
[Dynamic `import()`][] is supported in both CommonJS and ES modules. In CommonJS
335-
modules it can be used to load ES modules.
334+
[Dynamic `import()`][] provides an asynchronous way to import modules. It is
335+
supported in both CommonJS and ES modules, and can be used to load both CommonJS
336+
and ES modules.
336337

337338
## `import.meta`
338339

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.