mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
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>
20 lines
524 B
JavaScript
20 lines
524 B
JavaScript
export async function resolve(url, 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 (url === 'node:fs' || url.includes('loader')) {
|
|
return next(url);
|
|
}
|
|
|
|
const {
|
|
format,
|
|
url: nextUrl,
|
|
} = await next(url, context);
|
|
|
|
return {
|
|
format,
|
|
url: `${nextUrl}?foo`,
|
|
};
|
|
}
|