Does this package work with Cordova?
Opened this issue ยท 5 comments
I am trying to have the meteor create --vue
project working in development environment with Cordova on Android device.
Before moving forward, is it known to work?
Also, what would be the right configuration between ROOT_URL, MOBILE_ROOT_URL, --mobile-server
and the server
option in vite.config.js
file?
Thanks.
As long as you're on the most recent versions of jorgenvatle:vite-bundler
and meteor-vite
packages, Cordova should be compatible. I'm not sure if the current Meteor create command is using these packages by default, so you may have to upgrade after project creation.
Your mobile root URL can just be set to the same as your Meteor ROOT_URL
.
The server
option in your Vite config can be left empty. Any changes you make to the config like hostname or port should be handled accordingly by vite-bundler package.
I haven't personally tested with Cordova yet. If you run into any issues I'll do my best to help you out. In case you're having issues, could you set up an example repository that I can test against? ๐
Thanks.
I did not manage to run it with the Android emulator but with the Android device connected via USB and on the same Wifi network that my PC, yes.
I have configured the variables like that:
ROOT_URL=<IPOfMyPC>:3000
MOBILE_ROOT_URL=<IPOfMyPC>:3000
--mobile-server <IPOfMyPC>:3000
vite.config.js
=>host: <IPOfMyPC>
by running meteor run android --settings=./settings-development.json --mobile-server 192.168.1.98:3000
, i was able to run the application on the browser of my PC but I had error on the cordova application.
When I am adding --production
to the previous command line, the application works without any issue also on Cordova.
I will setup the repository with the simple example.
It could be that the Vite dev server is binding to localhost, so some of the client assets are timing out. Are you able to get the stack trace from Cordova?
I'll try to find some time to set up a Cordova example app in the coming week or two. ๐
Still haven't managed to get Cordova set up in my environment yet ๐
However, I just shipped a fix for an issue where the Vite dev server URL sent to clients would only be usable for clients on the same host machine. I suspect this could be why Cordova wasn't working.
Could give it another go with jorgenvatle:vite-bundler@1.12.10
and meteor-vite@1.10.2
and let me know how that goes?