Home » Javascript » javascript – Cordova not refresh index and auto reloading [close]

javascript – Cordova not refresh index and auto reloading [close]

Posted by: admin February 23, 2020 Leave a comment

Questions:

I am having difficulty with cordova.

At the start of the line
Cordova run browser everything opens, but if I modify the files, at refresh of browser, they always remain the same.

It is seen as: 304 /index.html instead of 200 and I don’t understand why.

Worse if I try with –livereload, which literally doesn’t work.

Tips? hypotheses?

 

 

 

I have found a stable solution:

I don’t find a method to do it directly in cordova. I don’t know why there is no option or something easy to understand to change it.

However …

1) install browser sync globally:

npm install -g browser-sync

2) install browser sync cordova plugin in your project

cordova plugin add cordova-plugin-browsersync

3) open browser and start a live server

cordova run browser --live-reload

at first glance it doesn’t seem very light … but it works.

How to&Answers: