From 035b92512bf4057ecba050d80c04d4b97205a4dd Mon Sep 17 00:00:00 2001 From: Sebastian Jeltsch Date: Thu, 5 Jun 2025 10:26:48 +0200 Subject: [PATCH] Also flip frozen lockfile fallback when PNPM_OFFLINE is set. --- trailbase-build/src/lib.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/trailbase-build/src/lib.rs b/trailbase-build/src/lib.rs index 4316ea3e..da7def77 100644 --- a/trailbase-build/src/lib.rs +++ b/trailbase-build/src/lib.rs @@ -100,17 +100,17 @@ pub fn build_js(path: impl AsRef) -> Result<()> { // parallel installs in the past. Our current approach is to recommend installing workspace // JS deps upfront in combination with `--prefer-offline`. We used to use plain `--offline`, // however this adds an extra mandatory step when vendoring trailbase for framework use-cases. - let args = [ - "--dir", - &path, - "install", - "--prefer-frozen-lockfile", - if offline { - "--offline" - } else { - "--prefer-offline" - }, - ]; + let args = if offline { + [ + "--dir", + &path, + "install", + "--prefer-frozen-lockfile", + "--prefer-offline", + ] + } else { + ["--dir", &path, "install", "--frozen-lockfile", "--offline"] + }; let build_result = pnpm_run(&args); if build_result.is_err() { error!(