From 71bc352328f4e6017b8f1cf013c3b3db560126ce Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 5 Jan 2022 10:54:13 +0100 Subject: [PATCH] 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 Reviewed-By: Luigi Pinca --- doc/api/esm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index c49581fc9ea491..47e718c9757400 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -623,8 +623,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