diff options
author | Lucas Azzola <derflatulator@gmail.com> | 2019-11-26 14:30:11 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-01-03 18:12:05 +0300 |
commit | a3861147e53993cdee9a2dba2f62499f999c52ff (patch) | |
tree | 1ffc763c175bb68bc956a50738cad5b49d22c29e /doc | |
parent | cc8c0b4cdea6617f0fe839ad30023c747c2ef83c (diff) |
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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/esm.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md index 5245cef465e..85f7b2d28dd 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -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"`. |