Skip to content

Commit

Permalink
feat(build): support prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Dec 13, 2023
1 parent 0f9a5df commit 0a5f603
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vinxi/lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import boxen from "boxen";
import { mkdir, rm, writeFile } from "fs/promises";
import { H3Event, createApp } from "h3";
import { createRequire } from "module";
import { build, copyPublicAssets, createNitro } from "nitropack";
import { build, copyPublicAssets, createNitro, prerender } from "nitropack";

import { writeFileSync } from "node:fs";
import { pathToFileURL } from "node:url";
Expand Down Expand Up @@ -298,6 +298,11 @@ export async function createBuild(app, buildConfig) {

await copyPublicAssets(nitro);
await app.hooks.callHook("app:build:nitro:assets:copy:end", { app, nitro });

await app.hooks.callHook("app:build:nitro:prerender:start", { app, nitro });
await prerender(nitro);
await app.hooks.callHook("app:build:nitro:prerender:end", { app, nitro });

await mkdir(join(nitro.options.output.serverDir), { recursive: true });

await app.hooks.callHook("app:build:nitro:start", { app, nitro });
Expand Down

0 comments on commit 0a5f603

Please sign in to comment.