0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 20:29:23 +01:00
nodejs/test/fixtures/es-module-loaders/loader-resolve-incomplete.mjs
Jacob Smith 4667b07cd2
esm: move hook execution to separate thread
PR-URL: https://github.com/nodejs/node/pull/44710
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Michaël Zasso <targos@protonmail.com>
2023-04-13 09:35:17 +02:00

14 lines
484 B
JavaScript

export async function resolve(specifier, context, next) {
// This check is needed to make sure that we don't prevent the
// resolution from follow-up loaders. It wouldn't be a problem
// in real life because loaders aren't supposed to break the
// resolution, but the ones used in our tests do, for convenience.
if (specifier === 'node:fs' || specifier.includes('loader')) {
return next(specifier);
}
return {
url: 'file:///incomplete-resolve-chain.js',
};
}