fix: single bundle APK build, remove debug banner, clean build scripts

- Remove debug red banner from index.html and main.tsx
- Add android:build:apk script that uses CAPACITOR_BUILD=1 for single
  bundle output + strips Shakespeare build artifacts from dist/index.html
- Update all android:* scripts to use android:build:apk

Root cause of white screen: 100+ JS chunk files overwhelm Android
WebView local file serving. Single bundle with inlineDynamicImports
fixes this.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-06-18 22:51:49 +07:00
parent fbdd0d7fbf
commit 3f654f4a35
3 changed files with 4 additions and 12 deletions

View file

@ -45,11 +45,6 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css"> <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css">
</head> </head>
<body> <body>
<!-- DEBUG: visible immediately before JS loads. If you see this red box,
HTML is loading but JS is failing. Remove once white screen is fixed. -->
<div id="debug-marker" style="position:fixed;top:0;left:0;right:0;background:#ff0040;color:#fff;padding:8px;font:bold 14px monospace;z-index:99999;text-align:center;">
SkateSpots loading... (v1.0.6-debug)
</div>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script> <script type="module" src="/src/main.tsx"></script>
</body> </body>

View file

@ -9,10 +9,11 @@
"build": "npm i --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'Project built successfully!'", "build": "npm i --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'Project built successfully!'",
"test": "npm i --silent && tsc --noEmit && eslint && vitest run --reporter=dot --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'All tests passed!'", "test": "npm i --silent && tsc --noEmit && eslint && vitest run --reporter=dot --silent && vite build -l error && cp dist/index.html dist/404.html && echo 'All tests passed!'",
"deploy": "npm i --silent && npm run build && npx -y nostr-deploy-cli deploy --skip-setup", "deploy": "npm i --silent && npm run build && npx -y nostr-deploy-cli deploy --skip-setup",
"android:init": "npm run build && npx cap add android && npx cap sync android", "android:init": "npm run android:build:apk && npx cap add android && npx cap sync android",
"android:sync": "npm run build && npx cap sync android", "android:sync": "npm run android:build:apk && npx cap sync android",
"android:open": "npx cap open android", "android:open": "npx cap open android",
"android:build": "npm run build && npx cap sync android && cd android && ./gradlew assembleRelease" "android:build": "npm run android:build:apk && npx cap sync android && cd android && ./gradlew assembleRelease",
"android:build:apk": "CAPACITOR_BUILD=1 vite build && sed -i 's|<script type=\"module\" src=\"/shakespeare_tailwind[^\"]*\\.js\"></script>||g' dist/index.html && sed -i 's|<style type=\"text/tailwindcss\">|<style>|g' dist/index.html && cp dist/index.html dist/404.html"
}, },
"dependencies": { "dependencies": {
"@bitcoinerlab/secp256k1": "^1.2.0", "@bitcoinerlab/secp256k1": "^1.2.0",

View file

@ -7,10 +7,6 @@ import { ErrorBoundary } from '@/components/ErrorBoundary';
import App from './App.tsx'; import App from './App.tsx';
import './index.css'; import './index.css';
// Remove debug marker — if JS reaches here, the script is executing
const debugMarker = document.getElementById('debug-marker');
if (debugMarker) debugMarker.remove();
// Hide Capacitor splash screen once JS is ready // Hide Capacitor splash screen once JS is ready
// Uses the global Capacitor object to avoid a hard dependency on the package // Uses the global Capacitor object to avoid a hard dependency on the package
if (typeof window !== 'undefined') { if (typeof window !== 'undefined') {