Ionic serve and custom cordova.js


#1

Hi,
for development in the browser, I am using the “ionic serve” command which supplies a cordova.js file which is empty apart from a comment line:
// mocked cordova.js response to prevent 404 errors during development

I would like to supply my own custom cordova.js file for browser development, e.g. by placing it in the www folder.

Is there a way to do this using “ionic serve” ?

Many thanks


#2

Which version of ionic-cli do you run? This used to be in lib/ionic/serve.js but this is no longer the case.


#3

Ionic CLI: v1.4.5
ionic framework: 1.0.0


#4

I have modified the serve.js file so that it will serve cordova.js from the www folder if there is one, otherwise it serves the mock version as it does currently.

Works fine.


#5

Have you looked at the various projects which build mocks for cordova?


#6

No, I haven’t needed to so far.

Do you have any recommendations ?


#7

No I was hoping you had one :wink: