Buckets:
| 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)) | |
| const channel = (() => { | |
| const raw = process.env.OPENCODE_CHANNEL | |
| if (raw === "dev" || raw === "beta" || raw === "prod") return raw | |
| if (process.env.OPENCODE_CHANNEL === "latest") return "prod" | |
| return "dev" | |
| })() | |
| /** | |
| * @type {import("vite").PluginOption} | |
| */ | |
| export default [ | |
| { | |
| name: "opencode-desktop:config", | |
| config() { | |
| return { | |
| resolve: { | |
| alias: { | |
| "@": fileURLToPath(new URL("./src", import.meta.url)), | |
| }, | |
| }, | |
| define: { | |
| "import.meta.env.VITE_OPENCODE_CHANNEL": JSON.stringify(channel), | |
| }, | |
| worker: { | |
| format: "es", | |
| }, | |
| } | |
| }, | |
| }, | |
| { | |
| 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(), | |
| ] | |
Xet Storage Details
- Size:
- 1.25 kB
- Xet hash:
- 27e35b805c5012497f8b479f8ed228f48047a81e02e80cd38a1a9a9719226ed1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.