From 167feb1d92d56559145250255d75d45d29684cea Mon Sep 17 00:00:00 2001 From: nojaf Date: Sun, 20 Jul 2025 12:21:31 +0200 Subject: [PATCH] Update compiler args for beta 2 --- server/src/incrementalCompilation.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index 8a6897c41..ad69a18fd 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -331,10 +331,8 @@ function getBscArgs( } } - const rewatchArguments = semver.satisfies(project.rescriptVersion, ">12.0.0-alpha.14", { includePrerelease: true }) ? [ + const rewatchArguments = semver.satisfies(project.rescriptVersion, ">=12.0.0-beta.2", { includePrerelease: true }) ? [ "compiler-args", - "--rescript-version", - project.rescriptVersion, entry.file.sourceFilePath, ] : [ "--rescript-version", @@ -342,9 +340,11 @@ function getBscArgs( "--compiler-args", entry.file.sourceFilePath, ]; + const bscExe = await utils.findBscExeBinary(entry.project.workspaceRootPath); + const env = bscExe != null ? { RESCRIPT_BSC_EXE: bscExe } : undefined; const compilerArgs = JSON.parse( cp - .execFileSync(rewatchPath, rewatchArguments) + .execFileSync(rewatchPath, rewatchArguments, { env }) .toString() .trim() ) as RewatchCompilerArgs;