Closed
Description
Currently whenever tns run <platform>
is executed the logic in CLI is as follows:
- Prepare the project if needed (this process includes moving files around in
platforms
, LiveSyncing files if needed, building and installing if required) - Start watching the project files for changes. Whenever changes occur CLI triggers the whole logic in 1.
This logic leads to some issues:
- Some plugins have
before-prepare
hooks which trigger some compilation for example andbefore-watch
hook, which starts some other watch process and the project files end up undergoing the same process twice
The proposed solution to this is to invert the logic and start the watcher initially and then force the first preparation. This will eliminate the aforementioned issues in all plugins (nativescript-dev-typescript
, nativescript-dev-sass
, nativescript-dev-webpack
, etc.). There is also an additional benefit to be gained with this approach - during the very first build of the project the user may make changes to the project files, which will be taken into account and LiveSynced - this functionality is currently missing.