From a5710b36111df946dafecafc290d7df59eb63597 Mon Sep 17 00:00:00 2001 From: Gigi Date: Tue, 7 Oct 2025 05:58:52 +0100 Subject: [PATCH] config: force SSR noExternal for applesauce packages - Add ssr.noExternal to force pre-bundling of applesauce packages - Add mainFields to resolve module entry points - Add rollupOptions to ensure ESM output format - Workaround for restrictive exports map in applesauce-core@4.0.0 --- dist/index.html | 2 +- vite.config.ts | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dist/index.html b/dist/index.html index 5bc80941..f20bb1ff 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 72c8faed..cb57718c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,7 +8,11 @@ export default defineConfig({ }, resolve: { extensions: ['.js', '.ts', '.tsx', '.json'], - conditions: ['import', 'module', 'browser', 'default'] + conditions: ['import', 'module', 'browser', 'default'], + // Disable strict package exports resolution to allow Rollup to resolve + // internal modules in packages with restrictive exports maps + preserveSymlinks: false, + mainFields: ['module', 'jsnext:main', 'jsnext', 'main'] }, optimizeDeps: { include: ['applesauce-core', 'applesauce-factory', 'applesauce-relay', 'applesauce-react'], @@ -20,7 +24,17 @@ export default defineConfig({ commonjsOptions: { include: [/node_modules/], transformMixedEsModules: true + }, + rollupOptions: { + output: { + // Ensure ESM output + format: 'es' + } } + }, + // Force pre-bundling of problematic packages + ssr: { + noExternal: ['applesauce-core', 'applesauce-factory', 'applesauce-relay'] } })