This is a project template for Svelte + CapacitorJS apps with live reload.
Note that you will need to have Node.js installed.
Install the dependencies...
cd svelte-capacitor
npm install
npm run dev
npx cap platform add android // (or ios)
You will need to append your workstation IP to the server.url
section in capacitor.config.json
Tip: Remember you will need the http://
before the server ip.
Back in the root folder:
npm run dev:android
or
npm run dev:ios
This will run the capacitor/svelte project with a web view pointing to your workstation's IP.
You should see the message Welcome to Svelte!
if svelte loaded correctly.
Try to change something in App.svelte, and you should see the content reload in your device.
- You need to have an emulator/device connected to adb
- Your device has to be connected to the same wifi network as your workstation.
Remember to remove the server.url
in capacitor.config.json
npm run build:android
or
npm run build:ios
--
This project was inspired by @syonip