Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a61cff4

Browse files
authoredApr 4, 2018
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
 

‎lib/after-watch.js

Lines changed: 1 addition & 1 deletion
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
}

‎package.json

Lines changed: 5 additions & 0 deletions
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)
This repository has been archived.