Spaces:
Running
Running
Download source/scripts/postbuild.mjs from Segizu/geometria3d-lab: direct link, hf CLI and curl.
- Browser
- Download file 971 Bytes
-
https://huggingface.co/spaces/Segizu/geometria3d-lab/resolve/main/source/scripts/postbuild.mjs
- Command line
-
hf download hf://spaces/Segizu/geometria3d-lab/source/scripts/postbuild.mjs
-
curl -L -o postbuild.mjs https://huggingface.co/spaces/Segizu/geometria3d-lab/resolve/main/source/scripts/postbuild.mjs
971 Bytes
| // 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'); | |