diff --git a/package.json b/package.json index a921640..df1eee2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "skate-spots", "private": true, - "version": "1.0.65", + "version": "1.0.66", "type": "module", "homepage": "https://skate-spots.com", "scripts": { diff --git a/vite.config.ts b/vite.config.ts index 0168f83..443af0b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -44,17 +44,23 @@ export default defineConfig(() => ({ transformMixedEsModules: true, }, rollupOptions: { - // IMPORTANT: installed Capacitor packages (@capacitor/core, @capacitor/camera) - // and the signer plugin MUST be bundled. Their JS API layer is real code that - // the WebView needs — the *native* implementation is injected at runtime via - // window.Capacitor, but the JS imports have to resolve. Externalizing them - // leaves bare `import "@capacitor/core"` specifiers in the output, which a - // native WebView cannot resolve → "Failed to resolve module specifier" crash. + // IMPORTANT: @capacitor/core and @capacitor/camera MUST be bundled (they are + // installed, statically imported, and their JS API layer is real code the + // WebView needs). Leaving them external emitted a bare `import "@capacitor/core"` + // specifier that a native WebView cannot resolve → white-screen boot crash. + // They are therefore intentionally ABSENT from this list. // - // Only the Capacitor packages that are NOT installed are kept external, so a - // stray import can't break the build. If one of these is ever added to - // package.json, remove it from this list so it gets bundled. + // Kept external: + // - nostr-signer-capacitor-plugin: installed from GitHub with a broken package + // entry point, so it CANNOT be bundled. It's only ever used via a guarded + // dynamic import() at runtime on native (see lib/capacitorAmberSigner.ts, + // wrapped in try/catch → returns null on failure), so external is correct + // and safe — a resolution failure degrades gracefully instead of crashing. + // - @capacitor/app|haptics|keyboard|status-bar: NOT installed and never + // statically imported (accessed via window.Capacitor.Plugins), so keeping + // them external prevents a stray import from breaking the build. external: [ + 'nostr-signer-capacitor-plugin', '@capacitor/app', '@capacitor/haptics', '@capacitor/keyboard',