Skip to content

Commit

Permalink
Fixes after self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Feb 21, 2024
1 parent 819ac47 commit dd2a90c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/vite/src/react-server-dom-webpack/node-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ function resolveClientImport(
)
}

/**
* Parses `body` for exports and stores them in `names` (the second argument)
*/
async function parseExportNamesIntoNames(
body: any,
names: Array<string>,
Expand Down Expand Up @@ -334,6 +337,7 @@ async function parseExportNamesIntoNames(
}

await parseExportNamesIntoNames(childBody, names, url, loader)

continue
}

Expand Down Expand Up @@ -431,7 +435,9 @@ async function loadClientImport(
throw new Error(
'Expected getSource to have been called before transformSource'
)
} // TODO: Validate that this is another module by calling getFormat.
}

// TODO: Validate that this is another module by calling getFormat.

const getSourceContext = { format: 'module' }
const { source } = await stashedGetSource(
Expand Down Expand Up @@ -537,9 +543,7 @@ export async function transformSource(
}
)

return {
source: newSrc,
}
return { source: newSrc }
}

return transformed
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/rsc/rscVitePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export function rscTransformPlugin(): Plugin {
}

const mod = await RSDWNodeLoader.load(id, null, load)

return mod.source
},
}
Expand Down

0 comments on commit dd2a90c

Please sign in to comment.