Skip to content

Commit

Permalink
Merge pull request #24 from Ak4zh/master
Browse files Browse the repository at this point in the history
switch to capacitor.config.ts from capacitor.config.json
added cordova-res to change splash screen
  • Loading branch information
drannex42 authored Feb 10, 2022
2 parents d473720 + da44533 commit b43bc07
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 39 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ Try to change something in `App.svelte`, and you should see the content reload o
* You need to have an emulator/device connected to adb
* Your device has to be connected to the same wifi network as your workstation.


### Change Splash screen and app icon:

* Add icon.png and splash.png to resources dir
* Recomended size:
- Icon - 512x512
- Splash - 1920x1920
* Next, run the following to generate all images then copy them into the native projects:
```
cordova-res ios --skip-config --copy
cordova-res android --skip-config --copy
```


### To build a production application:

**Remember to remove the `server.url` in `capacitor.config.json`**
Expand Down
17 changes: 0 additions & 17 deletions capacitor.config.json

This file was deleted.

23 changes: 23 additions & 0 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
appId: 'com.svelte.capacitor', // TODO: add your app id
appName: 'Svelte Capacitor',
webDir: 'public',
bundledWebRuntime: false,
plugins: {
"SplashScreen": {
"launchShowDuration": 0
}
},
// remove server section before making production build
server: {
// for android only, below settings will work out of the box
// for iOS or both, change the url to http://your-device-ip
// To discover your workstation IP, just run ifconfig
"url": "http://10.0.2.2:5001",
"cleartext": true
}
};

export default config;
34 changes: 15 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,29 @@
"version": "2.0.0",
"scripts": {
"#Build: Core": "Thesee scripts build the core application (routing logic, and views)",
"build:app": "routify -b && vite build",
"build:routify": "routify",

"build:app": "routify -b && vite build",
"build:routify": "routify",
"#Platform: Build": "These build the application for their specific platforms",
"build:android": "run-s build:app cap-run:android",
"build:ios": "run-s build:app cap-run:ios",

"build:android": "run-s build:app cap-run:android",
"build:ios": "run-s build:app cap-run:ios",
"#Platform: Sync": "These build the application for their specific platforms",
"cap-run:android": "cap sync android && cap open android",
"cap-run:ios": "cap sync ios && cap open ios",

"cap-run:android": "cap sync android && cap open android",
"cap-run:ios": "cap sync ios && cap open ios",
"#Dev: Platform": "These enable HMR (Hot module reloading) directly on the device - please check the readme.md for more on this.",
"dev:ios": "run-p dev:start cap-run:ios",
"dev:android": "run-p dev:start cap-run:android",

"dev:ios": "run-p dev:start cap-run:ios",
"dev:android": "run-p dev:start cap-run:android",
"#Dev: Core": "These allow the code to be developed with HMR",
"dev:preview": "vite preview",
"dev:start": "run-p build:routify dev:vite",
"dev:vite": "vite --host --port 5001",

"dev:preview": "vite preview",
"dev:start": "run-p build:routify dev:vite",
"dev:vite": "vite --host --port 5001",
"#Utilities": "Various utilities",
"validate": "svelte-check"
"validate": "svelte-check"
},
"devDependencies": {
"@roxi/routify": "^2.18.0",
"@sveltejs/vite-plugin-svelte": "*",
"@tsconfig/svelte": "^1.0.10",
"cordova-res": "^0.15.4",
"cross-env": "^7.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
Expand All @@ -44,8 +40,8 @@
},
"dependencies": {
"@capacitor/android": "^3.0.1",
"@capacitor/ios": "^3.0.1",
"@capacitor/cli": "^3.0.0",
"@capacitor/core": "^3.0.0"
"@capacitor/core": "^3.0.0",
"@capacitor/ios": "^3.0.1"
}
}
Empty file added resources/.gitkeep
Empty file.
Empty file added src/components/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion src/components/.hidden

This file was deleted.

Empty file added src/store/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion src/store/.hidden

This file was deleted.

Empty file added src/utils/.gitkeep
Empty file.
1 change: 0 additions & 1 deletion src/utils/.hidden

This file was deleted.

0 comments on commit b43bc07

Please sign in to comment.