{ // Debug configs for kjol-web (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-web: 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. "version": "0.2.0", "configurations": [ { "name": "kjol-web: dev server", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/kjol-web/server", "cwd": "${workspaceFolder}/go/cmd/kjol-web", "args": ["-addr", ":8085"], "preLaunchTask": "kjol-web: prebuild" }, { "name": "kjol-web: dev server (no watch)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/kjol-web/server", "cwd": "${workspaceFolder}/go/cmd/kjol-web", // -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-web: prebuild" }, { "name": "kjol-web: 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-web/server", "cwd": "${workspaceFolder}/go/cmd/kjol-web", "args": ["-build"] }, { "name": "kjol-web: codegen (wasmgen)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/wasmgen", "cwd": "${workspaceFolder}/go/cmd/kjol-web", "args": ["./app"] }, { "name": "kjol-web: 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-web", "args": [ "-app", "frontend", "-web", "../../jsruntime", "-out", "wwwroot", "-gen-ts", "frontend/src/ui/generated" ] } ] }