Run the toolchain's esbuild as itself: npm installs its native binary in place of the script

This commit is contained in:
jochen
2026-10-03 23:26:08 +02:00
parent ba189e6943
commit b0b3d87fe2
+3 -2
View File
@@ -1271,8 +1271,9 @@ func bundled(ctx context.Context, run Runner, tree string, chain Toolchain, base
launch = append(launch, out+"/"+l)
}
// Refused by name in an image that predates the bundler, as the dependencies copy is: a bundle
// packed without it would carry nothing it imports.
guard := `test -x "$0" || { echo "the toolchain image carries no bundler at $0: it predates one-file bundles, rebuild mesh-tools first" >&2; exit 1; }; exec node "$0" "$@"`
// packed without it would carry nothing it imports. Run as itself: npm installs esbuild's native
// binary in place of its script, which `node` cannot run.
guard := `test -x "$0" || { echo "the toolchain image carries no bundler at $0: it predates one-file bundles, rebuild mesh-tools first" >&2; exit 1; }; exec "$0" "$@"`
step := func(entries []string, extra ...string) error {
if len(entries) == 0 {
return nil