Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/check-pagefind.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const fs = require("fs");
const path = require("path");
const { execSync } = require("child_process");

const entryPath = path.join(__dirname, "..", "public", "pagefind", "pagefind-entry.json");

if (!fs.existsSync(entryPath)) {
console.warn(
"\x1b[33m⚠ Pagefind index not found. Search will not work in dev.\n" +
" Run: pnpm build-local-pagefind\x1b[0m\n"
console.log(
"\x1b[33mPagefind index not found — building it now from your content.\n" +
" (First run only; this does a full build and can take a minute or two.)\x1b[0m\n"
);
execSync("pnpm build-local-pagefind", { stdio: "inherit" });
process.exit(0);
}

Expand Down
Loading