{ // Debug configs for the gowasm example. cwd is the example dir because the // dev server resolves ./wwwroot, ./app, ./wasm and the watched engine dirs // relative to it. // // The dev-server configs preLaunchTask the prebuild (codegen + Tailwind). 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": "gowasm: dev server", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/examples/go-wasm-web/server", "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web", "args": ["-addr", ":8085"], "preLaunchTask": "gowasm: prebuild" }, { "name": "gowasm: dev server (no watch)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/examples/go-wasm-web/server", "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-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 CSS and generated code // there; without it you would be debugging against stale artefacts. "args": ["-watch=false"], "preLaunchTask": "gowasm: prebuild" }, { "name": "gowasm: codegen (wasmgen)", "type": "go", "request": "launch", "mode": "auto", "program": "${workspaceFolder}/go/cmd/wasmgen", "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web", "args": ["./app"] } ] }