-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix gulp watch stopping on error. #293
Conversation
Wouldn't it be more consistent with the other plugins I've seen to use gutil.PluginError instead of log ? It should take care of that |
That's a good point. I haven't been using gulp that long so I forgot about gutil. I updated the pull request. Let me know what you think. |
gutil.log(gutil.colors.red('[' + PLUGIN_NAME + '] ') + error.messageFormatted); | ||
var message = new gutil.PluginError('sass', error.messageFormatted).toString(); | ||
process.stderr.write(message + '\n'); | ||
this.emit('end'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you can just return a new gutil.PluginError looking at other gulp plugins using cb like https://github.com/wearefractal/gulp-coffee/blob/master/index.js#L38
Fix gulp watch stopping on error.
@Keats Just tested, |
This breaks my gulp setup - I'm not sure if I should open new issue, continue with discussion here or if I'm just using gulp-sass the wrong way. The stopping of watch on error was a big issue for me, so I found a workaround:
This permitted me to have visual bell in console ( My approach is broken by this commit, since I don't really understand javascript that much but since this line is the only usage of magic keyword |
Fixes #90. Related to: gulpjs/gulp#259
I think recommending people to not
return
the gulp stream is not a good idea, because gulp will not know when the task is complete, therefore any tasks that depend on sass being done will not be guaranteed that (think race conditions).