Skip to content

Commit

Permalink
fix: pass custom entry filename when resolving prerenderer (#2461)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts authored May 23, 2024
1 parent 0cba59d commit 9bd6622
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ export async function prerender(nitro: Nitro) {
await build(nitroRenderer);

// Import renderer entry
const serverFilename =
typeof nitroRenderer.options.rollupConfig?.output?.entryFileNames ===
"string"
? nitroRenderer.options.rollupConfig.output.entryFileNames
: "index.mjs";
const serverEntrypoint = resolve(
nitroRenderer.options.output.serverDir,
"index.mjs"
serverFilename
);
const { closePrerenderer, localFetch } = (await import(
pathToFileURL(serverEntrypoint).href
Expand Down

0 comments on commit 9bd6622

Please sign in to comment.