Do not mock cordova.js file if it exists
Hi,
I'm using the cordova.js file to mock plugins behaviours during browser development (https://github.com/loicknuchel/ionic-starter/blob/master/www/cordova.js).
When I'm using ionic serve the local server do not serve my cordova.js file but serve an empty mock file (https://github.com/driftyco/ionic-cli/blob/dd1085b1bf66f6ee69c90d90355d12f9a34d01ff/lib/ionic/serve.js#L247).
It could be nice to serve this mock file (to prevent 404 error) only if it doesn't exists or, at least, to give a option to desactivate this feature.
Thanks !
+1
An other thing, insted of injecting an empty cordova.js file, you could inject a cordova.js file containing plugin mocks... If you do so, browser development will be a lot easier...
I can make some pull-requests for mocks of common plugins :)
Unless I'm mistaken, I believe this issue also prevents Cordova plugins from being able to work under ionic run --livereload since ionic can't serve a valid cordova.js or cordova_plugins.js even if we copy it into the directory.
I'll see if I can get a --disable-cordova-mock flag working, since I'd like to be able to use plugins with ionic run --livereload if possible.
Update:
Never mind, ionic run --livereload does serve the correct cordova files if they exist.
Adding the flag ended up being pretty trivial though, so I did it anyways. =)
PR is here: https://github.com/driftyco/ionic-app-lib/pull/20
In the mean time you can give it a try with this fork of the ionic-cli: https://www.npmjs.com/package/ionic-no-cordova-mock