Skip to content

Commit 40b93b9

Browse files
committed
fix: properly close the watcher after tests
1 parent a81dc0f commit 40b93b9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pluginWebpack4.ts

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy