import {readFile,writeFile} from 'node:fs/promises'; import path from 'node:path'; const root=path.resolve(import.meta.dirname,'..'); const read=p=>readFile(path.join(root,p),'utf8'); let html=await read('public/index.html'); html=html.replace('data-theme="dark"','data-single-file="true" data-theme="dark"'); html=html.replace(/'); const notice='
Single file mode — read this first

This HTML includes the UI, font, images, games and tools. Open the file in a browser. No install needed.

Open hosted site

'; html=html.replace('
','
'+notice); html=html.replace(/
[\s\S]*?<\/details>/,'

Enter the relay passphrase in the embedded hosted view.

'); html=html.replace('href="/about.html"','href="https://zeyadsstuffv2.zeyadmused.workers.dev/about.html"'); html=html.replace('Download HTML','You are using the single HTML version.'); // No network code or passphrase is bundled. Local tools run directly in this file. html=html.replace('class="brand" href="/"','class="brand" href="#"'); await writeFile(path.join(root,'public/ZeyadsStuffV2.html'),html); console.log('Built single HTML file ('+Buffer.byteLength(html).toLocaleString()+' bytes).');