{ // Debug configs for kjol-website (the website). cwd is the site dir because the dev server // resolves ./wwwroot, ./app, ./wasm, ./frontend and the watched engine dirs relative // to it. // // Every dev-server config preLaunchTasks "kjol-website: prebuild" (codegen -> Tailwind -> // Solid bundle). Codegen must run before the server is COMPILED — it writes // app/*.gen.go, which the server imports — and under the debugger the binary is built // by Delve, not by the server's own Build hook, so nothing else would generate it. // // GOWORK=off on every config: kjol-website is its own module (module kjolwebsite, replace kjol // => ../..). Inside a parent project the parent's go.work — which lists kjol/go but not // kjolwebsite — shadows it, and the build fails "main module (...) does not contain package // .../kjol-website/server". Off, Go uses kjolwebsite's own go.mod; standalone it is a no-op. "version": "0.2.0", "configurations": [ { "name": "kjol-website: dev server", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/kjol-website/server", "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" }, "args": ["-addr", ":8085"], "preLaunchTask": "kjol-website: prebuild" }, { "name": "kjol-website: dev server (no watch)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/kjol-website/server", "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" }, // -watch=false skips the server's own Build entirely, so wwwroot is served exactly // as it sits on disk. The prebuild is what puts current generated code, CSS and JS // bundles there; without it you would be debugging against stale artefacts — and // with no bundle at all, every /js/* page would come up blank. "args": ["-watch=false"], "preLaunchTask": "kjol-website: prebuild" }, { "name": "kjol-website: cold build (-build)", "type": "go", "request": "launch", "mode": "auto", // The same binary, with the flag that runs every build step once and exits. There is // no separate ./build command: the steps are a library, because the server imports // them and Go will not let you import a main. "program": "${workspaceFolder}/go/cmd/kjol-website/server", "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" }, "args": ["-build"] }, { "name": "kjol-website: codegen (wasmgen)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/wasmgen", "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" }, "args": ["./app"] }, { "name": "kjol-website: bundle (Solid)", "type": "go", "request": "launch", "mode": "auto", // Debug the JS build itself — the Solid compiler, the Tailwind engine, the SSR bake. // All of it is Go, so all of it takes a breakpoint. "program": "${workspaceFolder}/go/cmd/bundle", "cwd": "${workspaceFolder}/go/cmd/kjol-website", "env": { "GOWORK": "off" }, "args": [ "-app", "frontend", "-web", "../../jsruntime", "-out", "wwwroot", "-gen-ts", "frontend/src/ui/generated" ] } ] }