Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/listening.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ const restartServer = (file, flags, watcher) => {
}
}

// Stop watching any files
watcher.close()

// Remove file that changed from the `require` cache
for (const item of toDelete) {
let location
Expand Down Expand Up @@ -102,7 +99,7 @@ module.exports = async (server, inUse, flags, sockets) => {
const watcher = watch(toWatch, watchConfig)

// Ensure that the server gets restarted if a file changes
watcher.on(
watcher.once(
'all',
debounce((event, filePath) => {
const location = path.relative(process.cwd(), filePath)
Expand Down