fix: single bundle mode for Capacitor APK builds
Use CAPACITOR_BUILD=1 env var to disable code splitting and produce a single JS bundle. This fixes the white screen caused by 100+ chunk file requests failing silently in Android WebView local file serving. Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
parent
379a5f7b34
commit
fbdd0d7fbf
1 changed files with 6 additions and 1 deletions
|
|
@ -38,7 +38,12 @@ export default defineConfig(() => ({
|
||||||
transformMixedEsModules: true,
|
transformMixedEsModules: true,
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: process.env.CAPACITOR_BUILD ? {
|
||||||
|
// Single bundle for Capacitor APK — avoids 100+ chunk file requests
|
||||||
|
// that fail silently in Android WebView local file serving
|
||||||
|
manualChunks: undefined,
|
||||||
|
inlineDynamicImports: true,
|
||||||
|
} : {
|
||||||
// Split large vendor libraries into separate cacheable chunks.
|
// Split large vendor libraries into separate cacheable chunks.
|
||||||
// Users only re-download a chunk when that specific library updates.
|
// Users only re-download a chunk when that specific library updates.
|
||||||
manualChunks(id) {
|
manualChunks(id) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue