doc: clarify entry point behavior when using loader hooks

Fixes: https://github.com/nodejs/node/issues/41275

PR-URL: https://github.com/nodejs/node/pull/41304
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Antoine du Hamel 2022-01-05 10:54:13 +01:00 committed by GitHub
parent bad65ea69d
commit b4908054d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -629,8 +629,8 @@ node b.mjs # works
To customize the default module resolution, loader hooks can optionally be
provided via a `--experimental-loader ./loader-name.mjs` argument to Node.js.
When hooks are used they only apply to ES module loading and not to any
CommonJS modules loaded.
When hooks are used they apply to the entry point and all `import` calls. They
won't apply to `require` calls; those still follow [CommonJS][] rules.
### Hooks