[FR]: Example usage that builds esbuild from go_binary rule and possible bug with ESBUILD_BINARY_PATH
What is the current behavior?
A platform-specific binary release of esbuild is downloaded and used for the esbuild binary. There are notes on how to configure a custom toolchain binary but no quick and easy code snippet.
I am able to get a custom version of esbuild working, but only with modifications of the rules_esbuild source (see https://github.com/aspect-build/rules_esbuild/pull/120 and in particular the change to esbuild.bzl, which seems necessary to properly set the ESBUILD_BINARY_PATH environment variable).
Describe the feature
Add a snippet that can be copy-pasted to easily use the version built from go source.
https://github.com/aspect-build/rules_esbuild/pull/120 allows an alternative binary to be specified like so:
esbuild_register_toolchains(
name = "esbuild",
esbuild_version = "0.17.5",
target_tool = "@com_github_evanw_esbuild//cmd/esbuild",
)
Merging that PR (or something like it) is a possibility, I suppose.
Fund our work
- [ ] Sponsor our open source work by donating a feature bounty
@gonzojive as soon as we figure out the question of your org submitting bug bounties, this would be a good candidate.