-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(nuxi): ignore buildDir on windows too #3999
Conversation
β Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -73,7 +73,7 @@ export default defineNuxtCommand({ | |||
const watcher = chokidar.watch([rootDir], { ignoreInitial: true, depth: 1 }) | |||
watcher.on('all', (event, file) => { | |||
if (!currentNuxt) { return } | |||
if (file.startsWith(withTrailingSlash(currentNuxt.options.buildDir))) { return } | |||
if (normalize(file).startsWith(withTrailingSlash(normalize(currentNuxt.options.buildDir)))) { return } |
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.
A note: buildDir
should be already normalized (all options from nuxt)
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.
Yes, it's probably just on Bridge that it is an issue.
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.
Would be nice to try normalizing srcDir
/buildDir
/rootDir
for bridge if that's the case. Potentially avoiding more of issues like this.
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.
Damn! I had some fun trying figure out where the error originated. For interest sake: my initial thoughts were that the watcher saw changes when /components was written to the build folder and tried to close the watcher at that point to trigger a 'restart'? :D This fix ignores the build path and avoids that, right?
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.
Precisely @Eckhardt-D it wasn't ignoring on windows...
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.
Great stuff. Thanks for the fix!
π Linked issue
resolves nuxt/bridge#84
resolves nuxt/bridge#75
may resolve some of the issues reported in nuxt/bridge#29, for example nuxt/bridge#29
β Type of change
π Description
Previously we were checking a string like
C:\\test\\.nuxt\\somefile.js
againstC:\\test\\.nuxt/
which would of course never match, meaning on Windows dev servers were immediately interrupting themselves and restarting when they noticed changes in.nuxt
.π Checklist