From b1286f7b7bf30af953c842a029b72db9855563de Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Tue, 13 Sep 2022 13:21:10 -0400 Subject: [PATCH] support node 16.17 loaders https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V16.md#experimental-esm-loader-hooks-api --- lib/node-loader-core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-loader-core.js b/lib/node-loader-core.js index e281036..d81a2f9 100644 --- a/lib/node-loader-core.js +++ b/lib/node-loader-core.js @@ -110,7 +110,7 @@ function createHook(name) { const config = await getConfigPromise(); const { resolvedLoaders } = config; const hook = resolvedLoaders[name]; - return hook(...args); + return hook(...args).then((r) => Object.assign(r, { shortCircuit: true })); } }; }