Make learning with flashcards more efficient and fun with a gamification approach.
Website not yet available.
App not yet available.
Additional libraries:
npx sv create my-app
- https://svelte.dev/docs/kit/creating-a-projectnpm i @capacitor/core
npm i -D @capacitor/cli
npx cap init
build
.npm i -D @sveltejs/adapter-static
. Add lines to svelte.config.js
to change adapter to static, adjust first line and add options to adapter. (See guide on ionic.io)The steps above is everything you need to setup the project.
To now open the app on the emulator we just need to:
npm run build
npx cap sync
npx cap open android
What about "hot module reloading" / "live reloading"?
For that adjust the vite.config.ts
and capacitor.config.json
.
To vite.config.ts add this:
server: {
host: '0.0.0.0',
port: 5173,
}
To capacitor.config.json add this:
server: {
url: 'http://10.0.2.2:5173',
cleartext: true
}
//vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
host: '0.0.0.0',
port: 5173,
}
});
//capacitor.config.json
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'game.tolearnkorean.com',
appName: 'gametolearnkorean',
webDir: 'build',
server: {
url: 'http://10.0.2.2:5173',
cleartext: true
}
};
export default config;
Now to make running the server as well as starting the android emulator easier I made it all into one command which you can run with npm run android-dev
. Add this to the package.json
and then under scripts
:"android-dev": "start /B npm run dev -- --host && npm run build && npx cap sync && npx cap open android"
When I first setup SvelteKit and added Capacitor I had a few low severity vulnerabilities from the "npm audit report", using "npm audit fix --force" didn't work since it resulted in an error.
Deleting node_modules
and package-lock.json
and using pnpm instead solved this issue for me.
npm install -g pnpm
pnpm install
pnpm audit --fix
Tauri has recently added the option to not only turn your website into a Windows and Mac app, but also Android and iOS. But that it's still very new and has a much smaller plugin ecosystem.