Spaces:
Running
Running
File size: 876 Bytes
87b5db3 | 1 2 3 4 5 6 7 8 9 10 11 | // Assemble the deployable Space folder (dist/): built app + docs + source copy for transparency.
import { cpSync, mkdirSync, rmSync } from 'node:fs';
const r = (p) => new URL('../' + p, import.meta.url).pathname;
for (const f of ['README.md', 'NOTICE', 'LICENSE', 'BROWSER_CHECKLIST.md']) cpSync(r(f), r('dist/' + f));
rmSync(r('dist/source'), { recursive: true, force: true });
mkdirSync(r('dist/source'), { recursive: true });
for (const f of ['src', 'tests', 'scripts', 'package.json', 'package-lock.json', 'vite.config.js', 'index.html', 'README.md', 'NOTICE', 'LICENSE', 'BROWSER_CHECKLIST.md']) cpSync(r(f), r('dist/source/' + f), { recursive: true });
// public/ without the generated wasm/ (recreated by `npm run copy-wasm`)
cpSync(r('public'), r('dist/source/public'), { recursive: true, filter: (p) => !p.includes('/public/wasm') });
console.log('dist assembled');
|