Files
netwatch/vite.config.js
T
clawbot 0f78f19a9d
check / check (push) Waiting to run
Move to the layout REPO_POLICIES.md gives (closes #30)
The Go module moves from backend/ to the root (go.mod, go.sum,
.golangci.yml, cmd/, internal/), the page's source to web/, and nginx's
two files to configs/. backend/ is gone: its LICENSE and .dockerignore
are deleted, and its .gitignore entries, README and scripts are folded
into the root ones. script/build builds the server binary after the
frontend; script/run and script/clean move up from backend/script/;
make test, lint, fmt and fmt-check do what the backend's did. Vite's
root is web/ and it still builds into dist/. script/bootstrap no longer
installs gcc, which only the host Go tests needed.

Model: opus-5-5
2026-10-14 08:56:45 +00:00

33 lines
1.0 KiB
JavaScript

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({
// The page's source is in web/; the build still goes to dist/ at the
// repo root, which Dockerfile and the viewport test serve. Vite
// empties only an outDir inside root unless told to.
root: "web",
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: {
outDir: "../dist",
emptyOutDir: true,
target: "esnext",
minify: "esbuild",
cssMinify: true,
},
});