Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 40b93b9

Browse filesBrowse files
committed
fix: properly close the watcher after tests
1 parent a81dc0f commit 40b93b9
Copy full SHA for 40b93b9

File tree

1 file changed

+9
-0
lines changed
Filter options

1 file changed

+9
-0
lines changed

‎src/pluginWebpack4.ts

Copy file name to clipboardExpand all lines: src/pluginWebpack4.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,15 @@ class VueLoaderPlugin {
171171
watcher.close()
172172
}
173173
})
174+
175+
// In some cases, e.g. in this project's tests,
176+
// even though needsHMR() returns true, webpack is not watching, thus no watchClose hook is called.
177+
// So we need to close the watcher when webpack is done.
178+
compiler.hooks.done.tap(id, () => {
179+
if (watcher) {
180+
watcher.close()
181+
}
182+
})
174183
}
175184
}
176185
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.