-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Relative path in custom watchers #3673
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #3673 +/- ##
==========================================
- Coverage 98.94% 98.94% -0.01%
==========================================
Files 18 18
Lines 1139 1134 -5
Branches 306 304 -2
==========================================
- Hits 1127 1122 -5
Misses 12 12
Continue to review full report at Codecov.
|
lib/builder/builder.js
Outdated
@@ -631,10 +633,10 @@ export default class Builder { | |||
}) | |||
|
|||
const nuxtRestartWatch = _.concat( | |||
this.options.watch, | |||
this.options.watch.map(path => r(path)), |
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.
Could this work as this.options.watch.map(r)
as well?
@manniL Indeed! Will update.
|
|
||
if (this.nuxtRestartWatcher) { | ||
this.nuxtRestartWatcher.close() | ||
for (const watcher in this.watchers) { |
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 this could be simplified. For example: Object.values(this.watchers).forEach(watcher => watcher && watcher.close())
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.
@manniL It's tempting, I know, but think about it. That'd be adding two unnecessary function calls to the stack. Object.values()
and forEach()
, in an obscurely constricted syntax. Using the native for()
makes it much more cleaner IMHO :)
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.
for of is proper here
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 mean with a map
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This was missing in #3633.