Skip to content

Commit bb9b6a8

Browse files
committed
fix(prerender): fix component graph tmp file
1 parent cf8847b commit bb9b6a8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/compiler/prerender/prerender-main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,15 @@ const runPrerenderOutputTarget = async (
192192
srcIndexHtmlPath,
193193
outputTarget,
194194
hydrateOpts,
195-
manager
195+
manager,
196196
);
197197
if (diagnostics.length > 0 || !templateData || !isString(templateData.html)) {
198198
return;
199199
}
200200

201201
manager.templateId = await createPrerenderTemplate(config, templateData.html);
202202
manager.staticSite = templateData.staticSite;
203-
manager.componentGraphPath = createComponentGraphPath(config, componentGraph, outputTarget);
203+
manager.componentGraphPath = await createComponentGraphPath(config, componentGraph, outputTarget);
204204

205205
await new Promise(resolve => {
206206
manager.resolve = resolve;
@@ -261,14 +261,14 @@ const createPrerenderTemplate = async (config: d.Config, templateHtml: string) =
261261
return templateId;
262262
};
263263

264-
const createComponentGraphPath = (
264+
const createComponentGraphPath = async (
265265
config: d.Config,
266266
componentGraph: d.BuildResultsComponentGraph,
267267
outputTarget: d.OutputTargetWww,
268268
) => {
269269
if (componentGraph) {
270270
const content = getComponentPathContent(componentGraph, outputTarget);
271-
const hash = config.sys.generateContentHash(content);
271+
const hash = await config.sys.generateContentHash(content);
272272
const fileName = `prerender-component-graph-${hash}.json`;
273273
const componentGraphPath = join(config.sys.tmpDirSync(), fileName);
274274
config.sys.writeFileSync(componentGraphPath, content);

0 commit comments

Comments
 (0)