michaelwayman / node-sass-chokidar

A thin wrapper around node-sass to replicate the --watch using chokidar instead of Gaze
MIT License
291 stars 34 forks source link

Bug in directory loop #93

Closed jimzezz closed 4 years ago

jimzezz commented 4 years ago

In https://github.com/michaelwayman/node-sass-chokidar/commit/c34bf7ed35634c35cfc56a5dab2562d33010f817 a check was added to skip files not matching a provided regexp but this causes the loop to stall indefinitely (or exit?) if a file is skipped. Not sure why the process doesn't hang but this causes subsequent files to not be processed.

Looks like this should just be a matter of moving the done listener inside the if condition, i.e

forEach(files, function(subject) {
  if (passesRegex(options, subject)) {
    emitter.once('done', this.async());
    renderFile(subject, options, emitter);
  }
}
bill-oneil commented 4 years ago

In my project, my css classes is overwriten by node_module css classes. Is this because recursive problem?