repos
/ orchard main

orchard

mirror

Every site I host, in one repo, along with the Cloudflare Tunnel and Caddy that front them. It's all Go, Vite, and SQLite, and it runs on a desktop at home with nothing listening on an inbound port.

blogbuncaddycloudflare-tunneldockergogolanghomelabhtml-templatemonorepoself-hostedseosqlitestatic-sitetypstuptime-monitoringviteweb-analytics

1.1 KB · 40 lines · JavaScript Raw History
 1import { resolve } from "path";
 2import { defineConfig } from "vite";
 3
 4// Four entry points, so the public collector embed and the dashboard's charts
 5// and map are separate downloads from the shell every page loads.
 6
 7export default defineConfig({
 8  base: "/static/",
 9  build: {
10    outDir: resolve(__dirname, "../build/dist"),
11    emptyOutDir: true,
12    manifest: true,
13    rollupOptions: {
14      input: {
15        base: resolve(__dirname, "static_src/base/index.js"),
16        pages: resolve(__dirname, "static_src/pages/index.js"),
17        properties: resolve(__dirname, "static_src/properties/index.js"),
18        collector: resolve(__dirname, "static_src/collector/index.js"),
19      },
20      output: {
21        entryFileNames: "assets/[name]-[hash].js",
22        chunkFileNames: "assets/[name]-[hash].js",
23        assetFileNames: (assetInfo) => {
24          if (/\.(png|jpg|gif|svg|webp)$/.test(assetInfo.name || "")) {
25            return "images/[name]-[hash][extname]";
26          }
27          return "assets/[name]-[hash][extname]";
28        },
29      },
30    },
31  },
32  css: {
33    preprocessorOptions: {
34      scss: {
35        quietDeps: true,
36      },
37    },
38  },
39});