Copy antipattern examples and browser detector to build output

These self-contained HTML files and the detector script were served
by the dev server from public/ but never made it into the Cloudflare
Pages build directory, causing 404s on the deployed site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-04-09 08:20:01 -07:00
co-authored by Claude Opus 4.6
parent 3769057e79
commit eeee5bc0aa
+14
View File
@@ -570,6 +570,20 @@ async function build() {
}
}
// Copy antipattern examples (self-contained HTML, not Bun entrypoints)
const examplesDir = path.join(ROOT_DIR, 'public', 'antipattern-examples');
if (fs.existsSync(examplesDir)) {
copyDirSync(examplesDir, path.join(buildDir, 'antipattern-examples'));
}
// Copy browser detector script (referenced by antipattern examples at /js/...)
const detectorSrc = path.join(ROOT_DIR, 'src', 'detect-antipatterns-browser.js');
if (fs.existsSync(detectorSrc)) {
const jsDir = path.join(buildDir, 'js');
fs.mkdirSync(jsDir, { recursive: true });
fs.copyFileSync(detectorSrc, path.join(jsDir, 'detect-antipatterns-browser.js'));
}
// Read source files (unified skills architecture)
const { skills } = readSourceFiles(ROOT_DIR);
const patterns = readPatterns(ROOT_DIR);