From 01986b23552d0a5b471273a30224817bd8ebf262 Mon Sep 17 00:00:00 2001 From: nojaf Date: Sat, 21 Jun 2025 11:48:11 +0200 Subject: [PATCH] Update rewatch compiler-args for alpha 14 --- server/src/incrementalCompilation.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index bc56ed19a..2bbe8a48c 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -312,14 +312,20 @@ function getBscArgs( } } } - const compilerArgs = JSON.parse( - cp - .execFileSync(rewatchPath, [ + const rewatchArguments = semver.satisfies(project.rescriptVersion, ">=12.0.0-alpha.14", { includePrerelease: true }) ? [ + "compiler-args", + "--rescript-version", + project.rescriptVersion, + entry.file.sourceFilePath, + ] : [ "--rescript-version", project.rescriptVersion, "--compiler-args", entry.file.sourceFilePath, - ]) + ]; + const compilerArgs = JSON.parse( + cp + .execFileSync(rewatchPath, rewatchArguments) .toString() .trim() ) as RewatchCompilerArgs;