From ebe267a69032b31b979d32a03a34f7ab814e6a5a Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Fri, 29 Sep 2017 09:39:09 +0300 Subject: [PATCH] Remove usbLiveSyncService.isInitialized check In case LiveSync process is currently running, `before-prepare` hook must not run the `tsc` compiler. We've been doing this by checking a special property from CLI - `usbLiveSyncService.isInitialized`. However, there's no need to use this service - we have the information if we have started `tsc` process, so just use it instead of relying on `usbLiveSyncService`. This will allow us to remove the usbLiveSyncService from CLI as it is no longer used anywhere. --- lib/before-prepare.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/before-prepare.js b/lib/before-prepare.js index e53483b..a9c492a 100644 --- a/lib/before-prepare.js +++ b/lib/before-prepare.js @@ -1,7 +1,7 @@ var compiler = require('./compiler'); -module.exports = function ($logger, $projectData, $usbLiveSyncService) { - var liveSync = $usbLiveSyncService.isInitialized; +module.exports = function ($logger, $projectData) { + var liveSync = !!compiler.getTscProcess(); var bundle = $projectData.$options.bundle; if (liveSync || bundle) { return;