From 9bd662258a3d727805248f69ea8280ccf8e31675 Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Thu, 23 May 2024 06:06:09 -0500 Subject: [PATCH] fix: pass custom entry filename when resolving prerenderer (#2461) --- src/prerender.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/prerender.ts b/src/prerender.ts index 38e750d938..858aa8c557 100644 --- a/src/prerender.ts +++ b/src/prerender.ts @@ -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