Copy static assets with stable URLs to build output

Bun's HTML bundler only includes assets referenced via <link href>
or <script src>, not <meta content> URLs. Root-level files like
og-image.png, robots.txt, and sitemap.xml were missing from the
build/ directory that Vercel serves, causing 404s for OG images.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-03-04 09:14:00 -08:00
co-authored by Claude Opus 4.6
parent 4ef56ed959
commit d9c14a44eb
+10
View File
@@ -136,6 +136,16 @@ async function build() {
// Bundle HTML, JS, and compiled CSS with Bun
await buildStaticSite();
// Copy root-level static assets that need stable (unhashed) URLs
const staticAssets = ['og-image.png', 'robots.txt', 'sitemap.xml', 'favicon.svg', 'apple-touch-icon.png'];
const buildDir = path.join(ROOT_DIR, 'build');
for (const asset of staticAssets) {
const src = path.join(ROOT_DIR, 'public', asset);
if (fs.existsSync(src)) {
fs.copyFileSync(src, path.join(buildDir, asset));
}
}
// Read source files
const { commands, skills } = readSourceFiles(ROOT_DIR);
const patterns = readPatterns(ROOT_DIR);