Cordova and Capacitor

Wrapping Framework7 in Cordova and Capacitor

A PWA cannot reach every native API or ship through the app stores; a WebView wrapper can. Ticking Cordova 129 or Capacitor 243,123 in framework7 create (Framework and Template) adds the native project and these scripts (CLI 9.0.2):

Native build scripts that the Framework7 CLI 89 generates
Script Runs
build-capacitor-android vite build, then npx cap copy android
build-capacitor-ios vite build, then npx cap copy ios
build-cordova-android vite build with TARGET=cordova, build/build-cordova.js, cordova build android
cordova-android The same, ending in cordova run android

For Capacitor the CLI writes capacitor.config.json with webDir: 'www', the folder Production Bundle fills, and adds @capacitor/core, app, keyboard, splash-screen, status-bar and browser; Framework7 572,986 's statusbar module (Badges and Statusbar) then drives the native status bar.

BookNest left both unticked: Cordova builds a Cordova app, and Capacitor adds Capacitor to this folder, from npx cap init to an APK on the emulator. Two rules carry over: create widgets in $f7ready or pageInit (Cart Sheet), and decide where the service worker belongs. Capacitor serves the app from https://localhost on Android, so the protocol test of Service Worker does not skip it there; a native app already ships its files, so test app.device.capacitor too.