Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
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 onindex.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
-
@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 myindex.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 thecordova.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.