From f7d8611031ddda97783fe5232feb0e2063e92546 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 23 Jul 2026 17:24:48 +0700 Subject: [PATCH] fix: externalize all Capacitor native plugins from rollup build Co-authored-by: shakespeare.diy --- vite.config.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 8683bc1..88ae21c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -39,10 +39,17 @@ export default defineConfig(() => ({ transformMixedEsModules: true, }, rollupOptions: { - // nostr-signer-capacitor-plugin is a native Capacitor plugin — it has no - // JS entry point and must be excluded from the bundle entirely. - // The plugin is injected at runtime by Capacitor on the native side. - external: ['nostr-signer-capacitor-plugin'], + // Native Capacitor plugins have no JS entry point — they are injected + // at runtime by Capacitor on the native side. Exclude them from the bundle. + external: [ + 'nostr-signer-capacitor-plugin', + '@capacitor/camera', + '@capacitor/core', + '@capacitor/app', + '@capacitor/haptics', + '@capacitor/keyboard', + '@capacitor/status-bar', + ], output: process.env.CAPACITOR_BUILD ? { // Single bundle for Capacitor APK — avoids 100+ chunk file requests // that fail silently in Android WebView local file serving