Skip to content

Commit

Permalink
feat(builtin): support yarn --frozen_lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan Jovanovic authored and alexeagle committed Aug 27, 2019
1 parent b4f526e commit 426861f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/npm_install/npm_install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ def _yarn_install_impl(repository_ctx):
str(repository_ctx.attr.network_timeout * 1000), # in ms
]

if repository_ctx.attr.frozen_lockfile:
args.append("--frozen-lockfile")

if repository_ctx.attr.prod_only:
args.append("--prod")
if not repository_ctx.attr.use_global_yarn_cache:
Expand Down Expand Up @@ -406,6 +409,13 @@ yarn_install = repository_rule(
doc = """Maximum duration of the command "yarn install" in seconds
(default is 3600 seconds).""",
),
"frozen_lockfile": attr.bool(
default = False,
doc = """Passes the --frozen-lockfile flag to prevent updating yarn.lock.
Note that enabling this option will require that you run yarn outside of Bazel
when making changes to package.json.""",
),
"network_timeout": attr.int(
default = 300,
doc = """Maximum duration of a network request made by yarn in seconds
Expand Down

0 comments on commit 426861f

Please sign in to comment.