stronggasil.blogg.se

Ionic run livereload not working
Ionic run livereload not working









ionic run livereload not working
  1. Ionic run livereload not working Patch#
  2. Ionic run livereload not working android#
  3. Ionic run livereload not working code#

It was always intended to be a parameter for the dev server, not for the cordova buids.

ionic run livereload not working

That's why I think the -livereload terminology is confusing. However the problem is that while ionic emulate -livereload pushes changes to the browser, it does not push them to the simulator. it watches for changes in src/ and pushes them to www/ and then updates the browser. With hindsight I believe there is confusion about the -livereload terminology because ionic serve -livereload works exactly as expected, i.e. The first one deals with webpack (src/ -> -livereload is a parameter for the dev server This means that building involves two different steps.

ionic run livereload not working

  • Perform an Ionic serve.I think the main point is : in Ionic 2 we are working off src/, not www/.
  • Copy Cordova assets into www (found in platforms/browser/platform_www).
  • Here’s what needs to happen for that to work: I want to combine the useful parts of ionic cordova run browser (browser shims) with the useful parts of ionic serve (dev server). When you make a change to your app, it has to be rebuilt and redeployed. But again, using that command is limiting because it doesn’t use the framework’s dev server and it doesn’t have livereload. This is why some people use ionic cordova run browser.

    Ionic run livereload not working android#

    If you know your app will only target Android and iOS, then suddenly it’s a pain to use ionic serve because the native functionality doesn’t work. The only useful part of the Cordova browser platform is the browser shims that plugins provide. Open browser to the static file server address.Run cordova serve, which uses a static file server with a root of that folder.Copy Cordova assets ( cordova.js, and the plugin javascript) into that folder.Run cordova run browser, which does the following under the hood:.For Ionic Angular 2/3, this is ionic-app-scripts build (this builds files into www) It doesn’t use the framework’s dev server, it doesn’t have livereload, it’s not configurable. Ionic cordova run browser spins up a static file server that I don’t want anyone to use. We’d basically be taking out the run First a little explanation: Everything this part of cordova-browser does, the Ionic CLI does. I imagine we can do something much like this for ionic serve -cordova/ ionic cordova run browser -livereload because cordova-browser does not respect the setting and it always opens a static file server, which is why I didn’t want to run the cordova run browser command at all. That’s what this does for angular projects: Going forward, that means not only do we need to copy platforms//platform_www into www, we need to configure the framework CLIs to know about those assets. We don’t have the ability to mock responses from the dev server in ng serve. We’ve had that luxury because until Ionic Angular 4, we’ve been writing the dev server (which is in now we want to take a step back and let the framework CLIs fill in. The webviews in Android and iOS then load content from the HTTP server, where all the cordova.js & cordova plugin JS responses are hijacked and routed to the appropriate files. Ionic cordova run android/ios -livereload sets the of config.xml to the address of the dev server.

    Ionic run livereload not working code#

    ionic serve -cordova is one little step towards this.Īgain, the Ionic CLI would make it very clear that the browser platform is only for testing an Android/iOS app in the browser, not for making a code base which works in Android/iOS and the browser. I see the future when developing for all platforms will be possible in a single environment. The ones who are against it, can simply avoid adding -cordova to their ionic serve, like they were always doing.

    Ionic run livereload not working Patch#

    Trying to patch Cordova’s static server with livereload is futile, why waste energy there? ionic serve -cordova is very logical, consistent and desirable. Having Ionic fully support all Cordova platforms, including browser, will give it a boost and stimulate further development. It is only a matter of more contributions to browser platform in Cordova, as browsers these days support a lot of native functions like camera. Next, browser support in Cordova will be improving with time. I’m sure no one will be confused if ionic serve supports Cordova with -cordova option. I see a huge value in having Cordova in ionic serve.Īt a minimum, it is only consistent with Ionic being built on top of Cordova, and having parity for all Cordova platforms, regardless of their current state. … are not to the point and have nothing to do with Ionic mission. The basic argument against the browser platform is that is pretty much an unkown Ionic serve doing anything with the Cordova Browser platform would be really unexpected and confusing.











    Ionic run livereload not working