map change
This commit is contained in:
@@ -65,10 +65,13 @@ for (const [token, tag] of await Promise.all(scriptJobs)) html = html.replace(to
|
||||
html = html.replace(/url\((['"]?)(assets\/[^'")]+)\1\)/g, (m, q, p) => (assets[p] ? `url('${assets[p]}')` : m));
|
||||
html = html.replace(/(src|href)="(assets\/[^"]+)"/g, (m, a, p) => (assets[p] ? `${a}="${assets[p]}"` : m));
|
||||
// everything the scripts load at runtime: must come before the first other <script>
|
||||
html = html.replace('<script>', () => `<script>window.KIT_ASSETS = ${JSON.stringify(assets)};</script>\n<script>`);
|
||||
// build stamp: identifies this exact release, so a leaked copy can be traced back
|
||||
const BUILD = new Date().toISOString().slice(0, 16).replace('T', '.').replace(/[:-]/g, '');
|
||||
html = html.replace('<script>', () => `<script>window.RC_BUILD = ${JSON.stringify(BUILD)};window.KIT_ASSETS = ${JSON.stringify(assets)};</script>\n<script>`);
|
||||
|
||||
html = html.replace('<head>', () => '<head><!-- Robot Clash (c) 2026 Michael Media | https://michael-media.de | build ' + BUILD + ' | Alle Rechte vorbehalten. Weitergabe oder Neuveroeffentlichung dieser Datei ist nicht gestattet. -->');
|
||||
const out = path.join(root, 'release', 'robotclash.html');
|
||||
fs.mkdirSync(path.dirname(out), { recursive: true });
|
||||
fs.writeFileSync(out, html);
|
||||
const mb = n => (n / 1024 / 1024).toFixed(1);
|
||||
console.log(`Fertig: ${out} (${mb(fs.statSync(out).size)} MB, ${Object.keys(assets).length} Assets, ${mb(bytes)} MB roh)`);
|
||||
console.log(`Fertig: ${out} (${mb(fs.statSync(out).size)} MB, ${Object.keys(assets).length} Assets, ${mb(bytes)} MB roh, Build ${BUILD})`);
|
||||
|
||||
Reference in New Issue
Block a user