import Config from "../config"; import packages from "./packages/index"; function escapeAttr(str: string): string { return str.replace(/&/g, "&").replace(/"/g, """).replace(/`; const packageLinks = stylesheets .map((css) => `\t`) .join("\n"); // Inject theme/package CSS after Vite's styles so theme overrides take effect const headInsert = [themeLink, packageLinks, ``] .filter(Boolean) .join("\n\t"); return html .replace("", `\t${headInsert}\n\t`) .replace(//g, themeColor) .replace("", Config.values.public ? "public" : "") .replace( "", escapeAttr(JSON.stringify(Config.values.transports)) ); }