Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic run browser --livereload not working

i was trying to use live reload on my ionic 2 application. so i found this command

ionic run browser --live-reload

is not working as expected and while making code changes i am receiving console messages

[16:12:47]  build started ...
[16:12:47]  transpile update started ...
[16:12:47]  transpile update finished in 46 ms
[16:12:47]  deeplinks update started ...
[16:12:47]  deeplinks update finished in 248 ms
[16:12:47]  webpack update started ...

but the page isn't reloading

like image 684
manish kumar Avatar asked May 25 '17 10:05

manish kumar


3 Answers

When you run the command ionic cordova run browser --livereload you will see something like this in CLI:

[19:39:00]  dev server running: http://localhost:8100/ 

[INFO] Development server running
       Local: http://localhost:8100
       External: http://192.168.0.51:8100

Just open http://192.168.0.51:8100 or http://localhost:8100 and your live reload will work on that address. Your browser might have opened in http://localhost:8000 instead of 8100

like image 22
FosAvance Avatar answered Nov 10 '22 09:11

FosAvance


i found the solution on the github page

include a script in the package.json file

"browser": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"

and run

npm run browser
like image 60
manish kumar Avatar answered Nov 10 '22 09:11

manish kumar


First off, should anyone need this answer, the command has been renamed in the later version to

ionic cordova run browser

Second, The --livereload flag is not supported when you run this command. this issue explains more

like image 4
franc Avatar answered Nov 10 '22 11:11

franc