Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit a61cff4

Browse files
fix(hooks): after-watch hook is not executed (#483)
The `after-watch` hook is not executed as it is not registered in the package.json. So it is never created in the projects, so the webpack process is not stopped when LiveSync should stop. In CLI process this is not a problem, but this is a huge issue for Sidekick, as the webpack watcher keeps watching the project and executes some actions.
1 parent b7ef84f commit a61cff4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: lib/after-watch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module.exports = function($logger) {
33
const webpackProcess = compiler.getWebpackProcess();
44
if (webpackProcess) {
55
$logger.info("Stopping webpack watch");
6-
webpack.kill("SIGINT");
6+
webpackProcess.kill("SIGINT");
77
}
88
}

Diff for: package.json

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
"script": "lib/before-watch.js",
2626
"inject": true
2727
},
28+
{
29+
"type": "after-watch",
30+
"script": "lib/after-watch.js",
31+
"inject": true
32+
},
2833
{
2934
"type": "before-watchPatterns",
3035
"script": "lib/before-watchPatterns.js",

0 commit comments

Comments
 (0)