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.0 KB · 38 lines · JavaScript Raw History
 1import { resolve } from "path";
 2import { defineConfig } from "vite";
 3
 4export default defineConfig({
 5  root: "static_src",
 6  base: "/static/",
 7  build: {
 8    outDir: resolve(__dirname, "../build/dist"),
 9    emptyOutDir: true,
10    manifest: true,
11    rollupOptions: {
12      input: resolve(__dirname, "static_src/index.js"),
13      output: {
14        entryFileNames: "base-[hash].js",
15        assetFileNames: (assetInfo) => {
16          if (/\.(woff2?|eot|ttf|otf)$/.test(assetInfo.name)) {
17            // Hashed, since web/static.go stamps a year of immutable on every
18            // asset the manifest lists, and a font swap at an unhashed name
19            // could never reach a returning visitor.
20            return "fonts/[name]-[hash][extname]";
21          }
22          if (/\.css$/.test(assetInfo.name)) {
23            return "base-[hash].css";
24          }
25          return "assets/[name]-[hash][extname]";
26        },
27      },
28    },
29  },
30  css: {
31    preprocessorOptions: {
32      scss: {
33        quietDeps: true,
34      },
35    },
36  },
37});