import { defineConfig } from "vite"; import tailwindcss from "@tailwindcss/vite"; import { execSync } from "child_process"; const commitHash = execSync("git rev-parse --short HEAD").toString().trim(); const commitFull = execSync("git rev-parse HEAD").toString().trim(); export default defineConfig({ plugins: [tailwindcss()], server: { // Proxy /api to a locally running netwatch-server so `yarn dev` // exercises the real report-posting path. proxy: { "/api": "http://127.0.0.1:8080", }, }, define: { __COMMIT_HASH__: JSON.stringify(commitHash), __COMMIT_FULL__: JSON.stringify(commitFull), }, build: { target: "esnext", minify: "esbuild", cssMinify: true, }, });