Livereload - app is not reloaded after making changes to code


#1

When I create a new blank Ionic 2 application with ionic start myProject blank --v2 --ts and run it on a device or an emulator with ionic run android -lcs the app runs and works fine. However, any changes I make to the application files (ts, html or scss) are seemingly ignored. I have to run the application again with ionic run android -lcs every time I make changes.

Is there something additional need after starting the project to get this working?

My ionic info is:

Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.4 Ionic CLI Version: 2.0.0-beta.24 Ionic App Lib Version: 2.0.0-beta.14 ios-deploy version: 1.8.5 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v5.10.1 Xcode version: Xcode 7.3 Build version 7D175


#2

So the problem here seems to have been me. I used -lcs which doesn’t work while using either -l or --livereload do work.

However since I want the console and server logs when I test the app I changed my gulpfile.js a bit to make -lcs work. The change I made was
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
to:
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1 || argv.indexOf('l');