Spaces:
Running
Running
File size: 971 Bytes
ab0a0fc | 1 2 3 4 5 6 7 8 9 10 11 12 | // Ensambla la carpeta desplegable (dist/): app compilada + docs + copia del código fuente.
import { cpSync, mkdirSync, rmSync, existsSync } from 'node:fs';
const r = (p) => new URL('../' + p, import.meta.url).pathname;
for (const f of ['README.md', 'NOTICE', 'LICENSE', 'BROWSER_CHECKLIST.md']) if (existsSync(r(f))) 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'])
if (existsSync(r(f))) cpSync(r(f), r('dist/source/' + f), { recursive: true });
cpSync(r('public'), r('dist/source/public'), { recursive: true, filter: (p) => !p.includes('/public/wasm') });
// el bundle de vite ya incluye su propia copia del .wasm en assets/ si lo referencia; nos quedamos con public/wasm
console.log('dist assembled');
|