cmd/tsconnect: stop writing build artifacts into src/

We can't write to src/ when tsconnect is used a dependency in another
repo (see also b763a12331). We therefore
need to switch from writing to src/ to using esbuild plugins to handle
the requests for wasm_exec.js (the Go JS runtime for Wasm) and the
Wasm build of the Go module.

This has the benefit of allowing Go/Wasm changes to be picked up without
restarting the server when in dev mode (Go compilation is fast enough
that we can do this on every request, CSS compilation continues to be
the long pole).

Fixes #5382

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
Mihai Parparita
2022-08-15 16:48:00 -07:00
committed by Mihai Parparita
parent facafd8819
commit 78b90c3685
2 changed files with 73 additions and 42 deletions

View File

@@ -1,4 +1,2 @@
src/wasm_exec.js
src/main.wasm
node_modules/
dist/