Ion Launch Browser - Doesn't Work

I tried using live reload in my ionic 2nd application. so i found this command

ionic run browser --live-reload

not working as expected, and when I change the code I get 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 does not reload

+6
source share
3 answers

I found a solution on github page

include script in 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
+2
source

When you run the command ionic cordova run browser --livereload, you will see something like this in the 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

http://192.168.0.51:8100 http://localhost:8100 . , http://localhost:8000 8100

+1

Using this command browser will restart automatically.

ionic serve

If you want to run the application on a different platform in a browser, you can use this command:

ionic serve -l

This command will automatically reload the page when the code changes.

-2
source

All Articles