Spaces:
Running
Running
Download scripts/build.mjs from orchestrel-ai/README: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/spaces/orchestrel-ai/README/resolve/main/scripts/build.mjs
- Command line
-
hf download hf://spaces/orchestrel-ai/README/scripts/build.mjs
-
curl -L -o build.mjs https://huggingface.co/spaces/orchestrel-ai/README/resolve/main/scripts/build.mjs
941 Bytes
| // Full card build: | |
| // 1. client build (CSS chunk for the static card) | |
| // 2. SSR build of the static entry (markup) | |
| // 3. render-card: self-contained static org card (dist/index.html) | |
| // 4. interactive React build for the Space (app/) | |
| // | |
| // npm install && node scripts/build.mjs | |
| // | |
| // Publish: | |
| // - dist/index.html -> index.html (org card, static, no scripts) | |
| // - app/ -> app/ (Space app, interactive React) | |
| import { execSync } from 'node:child_process' | |
| import { copyFileSync } from 'node:fs' | |
| execSync('npx vite build', { stdio: 'inherit' }) | |
| execSync('npx vite build --ssr src/App.jsx --outDir .ssr --emptyOutDir', { | |
| stdio: 'inherit', | |
| }) | |
| execSync('node scripts/render-card.mjs', { stdio: 'inherit' }) | |
| execSync('npx vite build --config vite.app.config.js', { stdio: 'inherit' }) | |
| copyFileSync('app/app.html', 'app/index.html') | |
| console.log('done: dist/index.html (static card) and app/ (interactive) ready') |