fix: externalize all Capacitor native plugins from rollup build

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-07-23 17:24:48 +07:00
parent 32b3a366b3
commit f7d8611031

View file

@ -39,10 +39,17 @@ export default defineConfig(() => ({
transformMixedEsModules: true, transformMixedEsModules: true,
}, },
rollupOptions: { rollupOptions: {
// nostr-signer-capacitor-plugin is a native Capacitor plugin — it has no // Native Capacitor plugins have no JS entry point — they are injected
// JS entry point and must be excluded from the bundle entirely. // at runtime by Capacitor on the native side. Exclude them from the bundle.
// The plugin is injected at runtime by Capacitor on the native side. external: [
external: ['nostr-signer-capacitor-plugin'], 'nostr-signer-capacitor-plugin',
'@capacitor/camera',
'@capacitor/core',
'@capacitor/app',
'@capacitor/haptics',
'@capacitor/keyboard',
'@capacitor/status-bar',
],
output: process.env.CAPACITOR_BUILD ? { output: process.env.CAPACITOR_BUILD ? {
// Single bundle for Capacitor APK — avoids 100+ chunk file requests // Single bundle for Capacitor APK — avoids 100+ chunk file requests
// that fail silently in Android WebView local file serving // that fail silently in Android WebView local file serving