mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc: clarify required flag for extensionless esm
Fixes: https://github.com/nodejs/node/issues/30655 PR-URL: https://github.com/nodejs/node/pull/30657 Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
This commit is contained in:
committed by
Myles Borins
parent
8b5b61a9a1
commit
3e5967bacb
@@ -84,7 +84,8 @@ If the nearest parent `package.json` lacks a `"type"` field, or contains
|
||||
`"type": "commonjs"`, extensionless and `.js` files are treated as CommonJS.
|
||||
If the volume root is reached and no `package.json` is found,
|
||||
Node.js defers to the default, a `package.json` with no `"type"`
|
||||
field.
|
||||
field. "Extensionless" refers to file paths which do not contain
|
||||
an extension as opposed to optionally dropping a file extension in a specifier.
|
||||
|
||||
`import` statements of `.js` and extensionless files are treated as ES modules
|
||||
if the nearest parent `package.json` contains `"type": "module"`.
|
||||
|
||||
Reference in New Issue
Block a user