Reapply "fix(app): more startup efficiency (#18985)"

This reverts commit cbe1337f24.
This commit is contained in:
Adam 2026-03-24 18:49:14 -05:00
commit 2b0baf97bd
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
8 changed files with 241 additions and 129 deletions

View file

@ -1,7 +1,10 @@
import { readFileSync } from "node:fs"
import solidPlugin from "vite-plugin-solid"
import tailwindcss from "@tailwindcss/vite"
import { fileURLToPath } from "url"
const theme = fileURLToPath(new URL("./public/oc-theme-preload.js", import.meta.url))
/**
* @type {import("vite").PluginOption}
*/
@ -21,6 +24,15 @@ export default [
}
},
},
{
name: "opencode-desktop:theme-preload",
transformIndexHtml(html) {
return html.replace(
'<script id="oc-theme-preload-script" src="/oc-theme-preload.js"></script>',
`<script id="oc-theme-preload-script">${readFileSync(theme, "utf8")}</script>`,
)
},
},
tailwindcss(),
solidPlugin(),
]