Skip to content

Commit 36cb694

Browse files
authored
Merge pull request #1104 from nojaf/rewatch-cli-update
Update rewatch compiler-args for higher than alpha 14
2 parents 74321fe + 79a8a11 commit 36cb694

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

server/src/incrementalCompilation.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,20 @@ function getBscArgs(
312312
}
313313
}
314314
}
315-
const compilerArgs = JSON.parse(
316-
cp
317-
.execFileSync(rewatchPath, [
315+
const rewatchArguments = semver.satisfies(project.rescriptVersion, ">12.0.0-alpha.14", { includePrerelease: true }) ? [
316+
"compiler-args",
317+
"--rescript-version",
318+
project.rescriptVersion,
319+
entry.file.sourceFilePath,
320+
] : [
318321
"--rescript-version",
319322
project.rescriptVersion,
320323
"--compiler-args",
321324
entry.file.sourceFilePath,
322-
])
325+
];
326+
const compilerArgs = JSON.parse(
327+
cp
328+
.execFileSync(rewatchPath, rewatchArguments)
323329
.toString()
324330
.trim()
325331
) as RewatchCompilerArgs;

0 commit comments

Comments
 (0)