Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(hooks): after-watch hook is not executed
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.
  • Loading branch information
rosen-vladimirov committed Apr 3, 2018
commit e99ea5175c71f1b974198993ff0271fc6b4b2268
2 changes: 1 addition & 1 deletion lib/after-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module.exports = function($logger) {
const webpackProcess = compiler.getWebpackProcess();
if (webpackProcess) {
$logger.info("Stopping webpack watch");
webpack.kill("SIGINT");
webpackProcess.kill("SIGINT");
}
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"script": "lib/before-watch.js",
"inject": true
},
{
"type": "after-watch",
"script": "lib/after-watch.js",
"inject": true
},
{
"type": "before-watchPatterns",
"script": "lib/before-watchPatterns.js",
Expand Down