From 2cea8fc2fa7ed63aac9c95e5f43712c10d033994 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 7 Oct 2025 05:57:36 +0100 Subject: [PATCH] config: add module resolution options for Vercel build - Add resolve conditions for better ESM handling - Configure esbuildOptions with resolveExtensions - Add commonjsOptions to handle mixed ESM/CJS modules - Attempt to fix applesauce-core async-event-store resolution issue --- dist/index.html | 2 +- vite.config.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dist/index.html b/dist/index.html index d8743679..5bc80941 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ Boris - Nostr Bookmarks - + diff --git a/vite.config.ts b/vite.config.ts index 88091f03..72c8faed 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,10 +7,20 @@ export default defineConfig({ port: 9802 }, resolve: { - extensions: ['.js', '.ts', '.tsx', '.json'] + extensions: ['.js', '.ts', '.tsx', '.json'], + conditions: ['import', 'module', 'browser', 'default'] }, optimizeDeps: { - include: ['applesauce-core', 'applesauce-factory', 'applesauce-relay', 'applesauce-react'] + include: ['applesauce-core', 'applesauce-factory', 'applesauce-relay', 'applesauce-react'], + esbuildOptions: { + resolveExtensions: ['.js', '.ts', '.tsx', '.json'] + } + }, + build: { + commonjsOptions: { + include: [/node_modules/], + transformMixedEsModules: true + } } })