fix(ui): emit ui-version.json and show UI source

This commit is contained in:
Shantur Rathore
2026-01-22 15:17:09 +00:00
parent a014ce555a
commit 02f1284f7f
2 changed files with 27 additions and 11 deletions

View File

@@ -1,10 +1,26 @@
import fs from "fs"
import { defineConfig } from "vite"
import solid from "vite-plugin-solid"
import { resolve } from "path"
const uiPackageJson = JSON.parse(fs.readFileSync(resolve(__dirname, "package.json"), "utf-8")) as { version?: string }
const uiVersion = uiPackageJson.version ?? "0.0.0"
export default defineConfig({
root: "./src/renderer",
plugins: [solid()],
plugins: [
solid(),
{
name: "emit-ui-version",
generateBundle() {
this.emitFile({
type: "asset",
fileName: "ui-version.json",
source: JSON.stringify({ uiVersion }, null, 2),
})
},
},
],
css: {
postcss: "./postcss.config.js",
},