I am utilizing Capacitor to construct a local app utilizing Vue.js.
I can get dwell reloading to work within the browser and the ios simulator, utilizing the next configs:
- The native dev server must be set to the ip:
0.0.0.0
. With Vue3/Vite it meant altering the script in package deal.json to…
"scripts": {
"dev": "vite --host 0.0.0.0",
- The vite configs have to set the server to the ip deal with on the community
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.instance.my_app',
appName: 'My App',
webDir: 'dist',
server: {
androidScheme: 'https',
url: 'http://192.168.x.xx:5173',
cleartext: true
}
};
export default config;
The Downside
My present configurations have an annoying downside! For those who construct the app with these settings, the app will solely work on the native community together with your dev server operating. You may remark out the url: http://...
within the configs after which the construct will work usually, however that is annoying and clunky.
How do I get dwell reloading to work in improvement, but additionally get the manufacturing construct to work with out having to hack the configs?