{"id":28146461,"url":"https://github.com/aspect-build/rules_esbuild","last_synced_at":"2025-10-29T23:36:28.956Z","repository":{"id":37080364,"uuid":"481653782","full_name":"aspect-build/rules_esbuild","owner":"aspect-build","description":"Bazel rules for https://esbuild.github.io/ JS bundler","archived":false,"fork":false,"pushed_at":"2025-10-28T16:03:56.000Z","size":353,"stargazers_count":32,"open_issues_count":25,"forks_count":35,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-28T18:06:51.477Z","etag":null,"topics":["bazel","bazel-rules"],"latest_commit_sha":null,"homepage":"","language":"Starlark","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspect-build.png","metadata":{"funding":{"github":null,"patreon":null,"open_collective":"aspect-build","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-14T15:22:44.000Z","updated_at":"2025-10-28T16:04:01.000Z","dependencies_parsed_at":"2024-02-16T23:07:29.563Z","dependency_job_id":"38072ad7-cdd3-4357-9218-9a7e1d52ab83","html_url":"https://github.com/aspect-build/rules_esbuild","commit_stats":{"total_commits":188,"total_committers":26,"mean_commits":7.230769230769231,"dds":0.5531914893617021,"last_synced_commit":"49510f4eaaab95a5c637dbdacc9f7bc9c80406fd"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":"bazel-contrib/rules-template","purl":"pkg:github/aspect-build/rules_esbuild","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspect-build%2Frules_esbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspect-build%2Frules_esbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspect-build%2Frules_esbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspect-build%2Frules_esbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspect-build","download_url":"https://codeload.github.com/aspect-build/rules_esbuild/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspect-build%2Frules_esbuild/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544195,"owners_count":26519554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","bazel-rules"],"created_at":"2025-05-14T23:12:36.525Z","updated_at":"2025-10-29T23:36:28.950Z","avatar_url":"https://github.com/aspect-build.png","language":"Starlark","funding_links":["https://opencollective.com/aspect-build"],"categories":["Starlark"],"sub_categories":[],"readme":"# Bazel rules for esbuild\n\nThis is a Bazel rule which wraps the esbuild CLI.\n\nFeatures:\n\n- Same API as the `@bazel/esbuild` package, so it's easy to migrate.\n- Use the Bazel downloader to fetch the npm package and the native binaries as described here:\n  \u003chttps://esbuild.github.io/getting-started/#download-a-build\u003e.\n  This means that the toolchain is fully self-contained and hermetic, and doesn't require you to\n  put esbuild in your package.json. These rules never run `npm install`.\n\n_Need help?_ This ruleset has support provided by https://aspect.build/services.\n\n## Installation\n\nFrom the release you wish to use:\n\u003chttps://github.com/aspect-build/rules_esbuild/releases\u003e\ncopy the WORKSPACE snippet into your `WORKSPACE` file.\n\n## Usage\n\nSee the [API documentation](https://registry.bazel.build/docs/aspect_rules_esbuild),\nand the example usage in the [`examples/`](https://github.com/aspect-build/rules_esbuild/tree/main/examples/) directory.\nNote that the examples rely on code in the `/WORKSPACE` file in the root of this repo.\n\n## From a BUILD file\n\nThe simplest usage is with the `esbuild` macro.\n\nIf needed, instead of the macro you could call the underlying `esbuild_bundle` rule directly.\n\n# In a macro\n\nYou could write a Bazel macro which uses esbuild, by calling it from a `genrule` or\n[`run_binary`](https://docs.aspect.build/bazelbuild/bazel-skylib/1.2.1/docs/run_binary_doc_gen.html#run_binary).\nFor this purpose, you can use the `ESBUILD_BIN` Make variable exposed by the\n`@aspect_rules_esbuild//esbuild:resolved_toolchain`.\nThis is illustrated in examples/macro.\n\n# In a custom rule\n\nThe most advanced usage is to write your own custom rule.\n\nThis is a good choice if you need to integrate with other Bazel rules via [Providers](https://docs.bazel.build/versions/main/skylark/rules.html#providers).\n\nYou can follow the example of `/esbuild/defs.bzl` by re-using the `lib` starlark struct exposed by\n`/esbuild/private/esbuild.bzl`.\nNote that this is a private API which can change without notice.\n\n## Custom Toolchain\n\nYou can register your own toolchain to provide an esbuild binary.\nFor example, you could build esbuild from source within the Bazel build, so that you can freely\nedit or patch esbuild and have those changes immediately reflected.\nYou'll need these things:\n\n1. A rule which builds or loads an esbuild binary, for example a `go_binary` rule.\n2. An `esbuild_toolchain` rule which depends on that binary from step 1 as the `target_tool`.\n3. A [`toolchain` rule](https://bazel.build/reference/be/platform#toolchain) which depends on\n   that target from step 2 as its `toolchain` and\n   `@aspect_rules_esbuild//esbuild:toolchain_type` as its `toolchain_type`.\n4. A call to [the `register_toolchains` function](https://bazel.build/rules/lib/globals#register_toolchains)\n   in your `WORKSPACE` that refers to the `toolchain` rule defined in step 3.\n\nSee e2e/toolchain_from_source for a complete example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspect-build%2Frules_esbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspect-build%2Frules_esbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspect-build%2Frules_esbuild/lists"}