Skip to content

Commit fbc6344

Browse files
committed
fix: disregard false matches from chokidar
Chokidar is firing events for files that don't match the glob when those files are under symlinked directories. Check that the path actually matches ".s[ac]ss" before triggering a compile. Fixes #94 & #85
1 parent 29c1711 commit fbc6344

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/watcher.js

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ var watcherOptions = {
2121

2222
watcher = choki.watch('**/*.s[ac]ss', watcherOptions)
2323
.on('all', (event, filePath) => {
24+
// Workaround for false matches from chokidar
25+
if (!filePath.match(/\.s[ac]ss$/i)) {
26+
return;
27+
}
28+
2429
watchPromisesChain = watchPromisesChain
2530
.then(() => compiler.compile({appDir, projectDir}))
2631
.catch(err => {

0 commit comments

Comments
 (0)