orchard
mirrorEvery 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
1import { resolve } from "path";
2import { defineConfig } from "vite";
3
4// Two entry points. base is the shell every page loads and pages is everything
5// else, which is small here: this site is forms and tables and has no charts.
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 },
18 output: {
19 entryFileNames: "assets/[name]-[hash].js",
20 chunkFileNames: "assets/[name]-[hash].js",
21 assetFileNames: (assetInfo) => {
22 if (/\.(png|jpg|gif|svg|webp)$/.test(assetInfo.name || "")) {
23 return "images/[name]-[hash][extname]";
24 }
25 return "assets/[name]-[hash][extname]";
26 },
27 },
28 },
29 },
30 css: {
31 preprocessorOptions: {
32 scss: {
33 quietDeps: true,
34 },
35 },
36 },
37});