Vue.js + Cordova / Where is cordova.js



  • Where is cordova.js in template https://github.com/OnsenUI/vue-cordova-webpack ?

    To use cordova features we need cordova.js file on index.html, but no existis in that template. Why?

    I found a external solution https://github.com/monaca/monaca-component-cordova-loader/blob/master/cordova-loader.js


  • Onsen UI

    @raphox cordova.js is generated by Cordova when you create your app (www/cordova.js). You won’t have that file in the browser. If you need to test the device back button, ESC key should fire a fake back button event in the browser :+1:



  • @Fran-Diox I know that cordova.js is generated by Cordova, but I know too that is files required in index.html when my app is executing on Android device.

    I inserted cordova-loader.js in my index.html:

      <body>
        <div id="app"></div>
        <!-- built files will be auto injected -->
        <script src="static/cordova-loader.js"></script>
      </body>
    

    The script cordova-loader.js knows when I open the app on android devise and includes the cordova.js dynamically. Its working, but I do not know why this does not exist in the template.

    From what I’ve been researching, I should necessarily use Monaca to generate my mobile application. But I’m directly using the cordova build android command.


Log in to reply