I'm trying to use Vue and Parcel along with Cordova.
But importing Cordova like import cordova from "cordova";
doesn't seem to work, and adding it as a script throws an error because it can't reference it.
My script looks like this in order to create the www folder parcel watch src/index.html --out-dir www --public-url /CordovaVue/app-cordova-vue/www
should I run something else beforehand?
I think you should add the cordova script dynamically. Like this:
// Dynamically load cordova
var cordova = document.createElement('script')
cordova.setAttribute('type','text/javascript')
cordova.setAttribute('src', 'cordova.js')
document.getElementsByTagName("head")[0].appendChild(cordova)
Source: https://github.com/Viglino/parcel-cordova/blob/master/index.js