import { readFile, writeFile } from 'node:fs/promises'; import { dirname, join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; const dist = resolve(dirname(fileURLToPath(import.meta.url)), '../dist'); let html = await readFile(join(dist, 'index.html'), 'utf8'); const scriptTag = /\n `); if (/src="\.\/assets\/|href="\.\/assets\/|href="\.\/HellNet_alt\.png"/.test(html)) { throw new Error('Standalone HTML still references external build assets'); } await writeFile(join(dist, 'hellcon-local.html'), html);