1681-engine / mobile / capacitorConfig
Function: capacitorConfig() ​
ts
function capacitorConfig(options): Record<string, unknown>;Defined in: src/mobile/capacitor.ts:82
A capacitor.config.ts for a game, with the defaults a game wants rather than a web page's:
- the page is served from
https://localhost(Android) so cookies,crypto.subtleand service workers behave as on the web, and nothing is fetched over plain http; - the web view does not scroll, bounce or zoom on iOS, and draws edge to edge (
contentInset: 'never', mind the safe area:safeAreaInsets); - the splash screen stays until the game hides it (
SplashScreen.hide()once the first scene draws), so the player never sees a blank web view; @capgo/capacitor-updaterdoes not update on its own: the engine'spickWebUpdatedecides.
ts
// capacitor.config.ts
import { capacitorConfig } from '1681-engine/mobile';
export default capacitorConfig({ appId: 'com.example.mygame', appName: 'My Game', debug: process.env.DEBUG === '1' });Parameters ​
| Parameter | Type |
|---|---|
options | MobileConfigOptions |
Returns ​
Record<string, unknown>