Fix browser script serving: run build after skill sync, serve via /js/

The skill sync wipes .claude/skills/ and re-copies from dist, deleting
the generated browser script. Moved build-browser-detector.js to run
AFTER the sync. Dev server's /js/* route now falls through to
.claude/skills/critique/scripts/ for built artifacts. All fixture HTML
references use /js/detect-antipatterns-browser.js (clean URL).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-03-17 18:26:51 -07:00
co-authored by Claude Opus 4.6
parent fbfe525f4f
commit d8803c8151
25 changed files with 44 additions and 51 deletions
+7 -7
View File
@@ -322,13 +322,6 @@ async function build() {
// Build CSS with Tailwind CLI (handles @theme directive)
buildTailwindCSS();
// Generate browser anti-pattern detector from core module
try {
execSync('node scripts/build-browser-detector.js', { cwd: ROOT_DIR, stdio: 'inherit' });
} catch (error) {
console.error('Failed to build browser detector:', error.message);
}
// Bundle HTML, JS, and compiled CSS with Bun
await buildStaticSite();
@@ -395,6 +388,13 @@ async function build() {
console.log(`📋 Synced to .claude/: skills`);
// Generate browser anti-pattern detector (after skill sync so it doesn't get overwritten)
try {
execSync('node scripts/build-browser-detector.js', { cwd: ROOT_DIR, stdio: 'inherit' });
} catch (error) {
console.error('Failed to build browser detector:', error.message);
}
console.log('\n✨ Build complete!');
}