Skip to content

Commit 12e7c5d

Browse files
committed
refactor: Remove unnecessary doc instantiation
1 parent d633f2d commit 12e7c5d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/plugins/prerender-plugin.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,10 @@ export function prerenderPlugin({ prerenderScript, renderTarget, additionalPrere
230230
return globalThis.unpatchedFetch(url, opts);
231231
};
232232

233-
// Grab the generated HTML file, which we'll use as a template:
233+
// Grab the generated HTML file, we'll use it as a template for all pages:
234234
const tpl = /** @type {string} */ (
235235
/** @type {OutputAsset} */ (bundle['index.html']).source
236236
);
237-
let htmlDoc = htmlParse(tpl, { comment: true });
238237

239238
// Create a tmp dir to allow importing & consuming the built modules,
240239
// before Rollup writes them to the disk
@@ -377,7 +376,7 @@ export function prerenderPlugin({ prerenderScript, renderTarget, additionalPrere
377376
}
378377

379378
// Reset HTML doc & head data
380-
htmlDoc = htmlParse(tpl, { comment: true });
379+
const htmlDoc = htmlParse(tpl, { comment: true });
381380
head = { lang: '', title: '', elements: new Set() };
382381

383382
// Add any discovered links to the list of routes to pre-render:

0 commit comments

Comments
 (0)