Build static Astro pilot for Happy Tails

This commit is contained in:
Kevin
2026-09-02 00:54:33 -04:00
parent cfe0a7d98d
commit 56a80951b7
42 changed files with 7171 additions and 134 deletions
+13
View File
@@ -0,0 +1,13 @@
import { existsSync } from 'node:fs';
import { spawnSync } from 'node:child_process';
const key = process.env.SITE_KEY;
if (!key || !/^[a-z0-9][a-z0-9-]{0,62}$/.test(key) || !existsSync(`sites/${key}/site.json`)) {
throw new Error('SITE_KEY must be a manifest-defined site directory.');
}
const result = spawnSync('npm', ['run', 'build', '--', '--outDir', `dist/${key}`], {
env: { ...process.env, SITE_KEY: key },
stdio: 'inherit'
});
if (result.status !== 0) process.exit(result.status ?? 1);