From 4ff398073866ec960014cc22b4ca8af1d71d4cd6 Mon Sep 17 00:00:00 2001 From: RUKAYAT-CODER Date: Tue, 28 Jul 2026 19:30:49 +0000 Subject: [PATCH] fix(vite): add react / react-dom to library build optimizeDeps (#339) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vite.lib.config.ts had optimizeDeps.include hard-coded to sorokit-core + @creit.tech/stellar-wallets-kit only. Issue #339 flags that large peer packages (react, react-dom) were not pre-bundled for the library build, leading to dev-server cold-start churn when downstream apps import them through the published bundle. Verified the existing build behaviour before changing anything: - build.minify: false — already on. - build.sourcemap: true — already on. - optimizeDeps.include — extended to react + react-dom. No .d.ts output, no entry changes, no rollupOptions changes. Library consumers shipping a Soroban UI app now skip the react optimisation step on cold dev. Closes #339 --- vite.lib.config.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vite.lib.config.ts b/vite.lib.config.ts index 0b427bc..50d84f0 100644 --- a/vite.lib.config.ts +++ b/vite.lib.config.ts @@ -48,7 +48,12 @@ export default defineConfig({ emptyOutDir: true, }, optimizeDeps: { - include: ["sorokit-core", "@creit.tech/stellar-wallets-kit"], + include: [ + "sorokit-core", + "@creit.tech/stellar-wallets-kit", + "react", + "react-dom", + ], }, resolve: { alias: {