• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1export async function resolve(url, context, next) {
2  // This check is needed to make sure that we don't prevent the
3  // resolution from follow-up loaders. It wouldn't be a problem
4  // in real life because loaders aren't supposed to break the
5  // resolution, but the ones used in our tests do, for convenience.
6  if (url === 'node:fs' || url.includes('loader')) {
7    return next(url);
8  }
9
10  const {
11    format,
12    url: nextUrl,
13  } = await next(url, context);
14
15  return {
16    format,
17    url: `${nextUrl}?foo`,
18  };
19}
20