From 014d4836ec1d677cbcbcdde74f1563bf5a191f75 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 784573e11b5491..ec4c7b1ce650c2 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -628,8 +628,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