Revert "perf(core): very simplistic minifier for homepage (#2630)" (#2641)

This reverts commit ae96912699.
This commit is contained in:
Eric Dubé
2026-03-10 21:36:14 -04:00
committed by GitHub
parent ae96912699
commit 05b047c8b9
@@ -283,7 +283,7 @@ export class PuterHomepageService extends BaseService {
},
};
await eventService.emit('puter.gui.addons', event);
let htmlOutput = `<!DOCTYPE html>
return `<!DOCTYPE html>
<html lang="en">
<head>
@@ -437,24 +437,6 @@ export class PuterHomepageService extends BaseService {
</body>
</html>`;
// A mostly minimal minifier that minifies minimally
// - this is NOT a general-purpose HTML minifier
// - it does not account for <pre> tags
// - it does not minify javascript code
htmlOutput = htmlOutput //...
// remove regular HTML comments, but keep conditional comments
.replace(/<!--(?!\[if[\s\S]*?]|<!|>)[\s\S]*?-->/g, '')
// collapse whitespace between tags
.replace(/>\s+</g, '><')
// collapse runs of whitespace
.replace(/\s+/g, ' ')
// remove extra space around = in attributes
.replace(/\s*=\s*/g, '=')
// remove spaces before tag close
.replace(/\s+>/g, '>')
.trim();
return htmlOutput;
};
generate_error_html ({ message }) {