Skip to content

Commit

Permalink
Merge pull request #108 from JakobJingleheimer/patch-1
Browse files Browse the repository at this point in the history
fix: loader stomping context from other loaders
  • Loading branch information
giltayar authored Mar 16, 2024
2 parents 0cfc7b6 + e8f1211 commit fdf9156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/quibble.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ export async function resolve (specifier, context, nextResolve) {
const { parentURL } = context

try {
const { url } = await resolve()
const { url, ...ctx } = await resolve()

const quibbledUrl = addQueryToUrl(url, '__quibble', stubModuleGeneration)

if (url.startsWith('node:') && !getStubsInfo(quibbledUrl)) {
return { url }
return { ...ctx, url } // It's allowed to change ctx for a builtin (but unlikely)
}

return { url: quibbledUrl }
return { ...ctx, url: quibbledUrl }
} catch (error) {
if (error.code === 'ERR_MODULE_NOT_FOUND') {
return {
Expand Down

0 comments on commit fdf9156

Please sign in to comment.