Skip to content

Commit 18dade7

Browse files
authored
Prevent non-terminating build (rescript-lang#5485)
1 parent a459fcc commit 18dade7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rescript

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ var lockFileName = path.join(cwd, ".bsb.lock");
2828
process.env.BSB_PROJECT_ROOT = cwd;
2929
// console.log('BSB_PROJECT_ROOT:', process.env.BSB_PROJECT_ROOT)
3030

31+
// If the project uses gentype and uses custom file extension
32+
// via generatedFileExtension, ignore them in watch mode
33+
var genTypeConfig = require(path.join(cwd, bsconfig)).gentypeconfig
34+
if (genTypeConfig) {
35+
var genTypeFileExtension = genTypeConfig.generatedFileExtension
36+
}
37+
3138
// All clients of type MiniWebSocket
3239
/**
3340
* @type {any[]}
@@ -406,6 +413,7 @@ if (
406413
fileName.endsWith(".mjs") ||
407414
fileName.endsWith(".cjs") ||
408415
fileName.endsWith(".gen.tsx") ||
416+
fileName.endsWith(genTypeFileExtension) ||
409417
watch_generated.indexOf(fileName) >= 0 ||
410418
fileName.endsWith(".swp")
411419
);

0 commit comments

Comments
 (0)