Skip to content

Commit e38101e

Browse files
committed
clarify optional extensions for bare specifiers
1 parent abf52d3 commit e38101e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/esm.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ There are three types of specifiers:
118118

119119
* _Relative specifiers_ like `'./startup.js'` or `'../config.mjs'`. They refer
120120
to a path relative to the location of the importing file. _The file extension
121-
is always mandatory for these._
121+
is always necessary for these._
122122

123123
* _Bare specifiers_ like `'some-package'` or `'some-package/shuffle'`. They can
124124
refer to the main entry point of a package by the package name, or a
125125
specific feature module within a package prefixed by the package name as per
126-
the examples respectively. _The file extension is optional for these._
126+
the examples respectively. _Including the file extension is only necessary
127+
for packages without an [`"exports"`][] field._
127128

128129
* _Absolute specifiers_ like `'file:///opt/nodejs/config.js'`. They refer
129130
directly and explicitly to a full path.

0 commit comments

Comments
 (0)