From 3e8db5698e3dc5e226a8dd9d549974d5eb95a294 Mon Sep 17 00:00:00 2001 From: Erudition Date: Mon, 20 Nov 2023 16:53:42 -0600 Subject: [PATCH] Fix prod build errors by disabling manual chunks --- vite.config.ts | 38 +++++++++++++++++++------------------- www/index.html | 2 +- www/index.ts | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index cfa4cd0f..24aa982e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,7 @@ import { VitePWA } from 'vite-plugin-pwa' export default defineConfig({ // identify what plugins we want to use - plugins: [ // PWA plugin causing import errors + plugins: [ // PWA plugin causing capacitor errors VitePWA({ registerType: 'autoUpdate', // After messing with service worker you may need to rm -rf android/app/src/main/assets/* before sync. https://github.com/ionic-team/capacitor/issues/5430#issuecomment-1042990925 //devOptions: {enabled: true}, @@ -62,24 +62,24 @@ export default defineConfig({ //maxParallelFileOps: 2, output: { sourcemap: true, //don't sourcemap node_modules? - manualChunks: (id) => { - // this makes node_modules manually chunked so we don't have a huge index.ts file or too many micro js files - if (id.includes('capacitor')) { - return 'capacitor-modules'; - } else if (id.includes('libp2p')) { - return 'libp2p-modules'; - } else if (id.includes('ipfs') || id.includes('helia') || id.includes('multiaddr') || id.includes('multiformats')) { - return 'ipfs-modules'; - } else if (id.includes('orbit') || id.includes('orbit-db') || id.includes('dids') || id.includes('apg-js')) { - return 'orbit-modules'; - } else if (id.includes('ionic') || id.includes('ion-')) { - return 'ionic-modules'; - } else if (id.includes('elm')) { - return 'elm-modules'; - } else if (id.includes('node_modules')) { - return 'other-modules'; - } - }, + // manualChunks: (id) => { + // // this makes node_modules manually chunked so we don't have a huge index.ts file or too many micro js files + // if (id.includes('capacitor')) { + // return 'capacitor-modules'; + // } else if (id.includes('libp2p')) { + // return 'libp2p-modules'; + // } else if (id.includes('ipfs') || id.includes('helia') || id.includes('multiaddr') || id.includes('multiformats')) { + // return 'ipfs-modules'; + // } else if (id.includes('orbit') || id.includes('orbit-db') || id.includes('dids') || id.includes('apg-js')) { + // return 'orbit-modules'; + // } else if (id.includes('ionic') || id.includes('ion-')) { + // return 'ionic-modules'; + // } else if (id.includes('elm')) { + // return 'elm-modules'; + // } else if (id.includes('node_modules')) { + // return 'other-modules'; + // } + // }, } } }, diff --git a/www/index.html b/www/index.html index f57bf0ca..54696dbb 100644 --- a/www/index.html +++ b/www/index.html @@ -21,7 +21,7 @@ - + diff --git a/www/index.ts b/www/index.ts index c02f13b8..2c9748f0 100644 --- a/www/index.ts +++ b/www/index.ts @@ -138,7 +138,7 @@ function elmStarted(app) { Toast.show({ text: window.location.href, duration: "short"}).then(); try { //attachOrbit(app); - attachODDManual(app); + //attachODDManual(app); } catch (problemWithOrbit) { console.error("Failed to attach Orbit to Elm!", problemWithOrbit)