Commit d853758a authored by guybedford's avatar guybedford Committed by Michaël Zasso
Browse files

module: fix hook module CJS dependency loading

It can be useful to load dependencies as part of the loader hook
definition file. This fixes a bug where `import x from 'x'` would
always return `x` as `undefined` if the import was made in a loader
hooks definition module.

A parallel change to the CJS loading injection process meant that the
CJS module wasn't being injected into the correct loader instance,
which is corrected here with a test.

PR-URL: https://github.com/nodejs/node/pull/16381


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
parent edd78f86
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment