Generate App Icon and Splash Screen Images for Ionic Framework using Capacitor
A handy script to help you generate app icon and splash screen images for your Ionic app using Capacitor.
Ionic Framework is awesome for build hybrid mobile apps and progressive web apps (PWA). And Capacitor is a great alternative to using Cordova taking a more modern approach to leveraging native SDKs that works on both mobile and web.
However after making to switch to Capacitor, I missed using cordova-resources which generates all the various sizes of the app icon and splash screen simply by running ionic cordova resources
.
Generate perfectly sized icons and splash screens from PNG source images for your Cordova platforms with this command.
The source image for icons should ideally be at least 1024×1024px and located at resources/icon.png. The source image for splash screens should ideally be at least 2732×2732px and located at resources/splash.png.
Since other Ionic developers using Capacitor are probably also missing this functionality, I wrote a script to add this to your projects.
https://gist.github.com/dalezak/a6b1de39091f4ace220695d72717ac71
In your Ionic Capacitor project, just follow these steps:
- Run
npm install cordova-res
…