Skip to content

Commit 609905a

Browse files
committed
Update watcher rules
1 parent c799ba1 commit 609905a

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

rescript

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ process.env.BSB_PROJECT_ROOT = cwd;
2323
const isTtyError = process.stderr.isTTY;
2424
const isTtyStd = process.stdout.isTTY;
2525

26-
// If the project uses gentype and uses custom file extension
27-
// via generatedFileExtension, ignore them in watch mode
28-
var bsConfigFile = path.join(cwd, bsconfig);
29-
var genTypeFileExtension = ".gen.tsx";
30-
if (fs.existsSync(bsConfigFile)) {
31-
var genTypeConfig = require(bsConfigFile).gentypeconfig;
32-
if (genTypeConfig) {
33-
genTypeFileExtension = genTypeConfig.generatedFileExtension;
34-
}
35-
}
36-
3726
let verbose = false;
3827

3928
/**
@@ -358,14 +347,13 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
358347
// This could cause problems if source builds (generating js files in the same directory) are supported.
359348
if (!fileName) return true;
360349

361-
return !(
362-
fileName === ".merlin" ||
363-
fileName.endsWith(".js") ||
364-
fileName.endsWith(".mjs") ||
365-
fileName.endsWith(".cjs") ||
366-
fileName.endsWith(genTypeFileExtension) ||
367-
watchGenerated.indexOf(fileName) >= 0 ||
368-
fileName.endsWith(".swp")
350+
return (
351+
((fileName.endsWith(".res") ||
352+
fileName.endsWith(".resi") ||
353+
fileName.endsWith(".ml") ||
354+
fileName.endsWith(".mli")) &&
355+
!watchGenerated.includes(fileName)) ||
356+
fileName === bsconfig
369357
);
370358
}
371359

0 commit comments

Comments
 (0)