Skip to content

Commit

Permalink
fix(esbuild): allow passing additional args to the npm install for es…
Browse files Browse the repository at this point in the history
…build
  • Loading branch information
mattem committed Nov 5, 2021
1 parent 5e2df66 commit f81a0a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toolchains/esbuild/esbuild_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)

def esbuild_repositories(name = "", npm_repository = "npm"):
def esbuild_repositories(name = "", npm_repository = "npm", npm_args = []):
"""Helper for fetching and setting up the esbuild versions and toolchains
This uses Bazel's downloader (via `http_archive`) to fetch the esbuild package
Expand All @@ -31,6 +31,7 @@ def esbuild_repositories(name = "", npm_repository = "npm"):
name: currently unused
npm_repository: the name of the repository where the @bazel/esbuild package is installed
by npm_install or yarn_install.
npm_args: additional args to pass to the npm install rule
"""

for name, meta in ESBUILD_PACKAGES.platforms.items():
Expand Down Expand Up @@ -68,7 +69,7 @@ def esbuild_repositories(name = "", npm_repository = "npm"):
"--no-optional",
# Disable scripts as we don't need the javascript shim replaced wit the binary.
"--ignore-scripts",
],
] + npm_args,
symlink_node_modules = False,
package_path = package_path,
)

0 comments on commit f81a0a1

Please sign in to comment.