Skip to content

fix(vite): add react / react-dom to library build optimizeDeps (#339) - #385

Open
RUKAYAT-CODER wants to merge 1 commit into
Sorokit:mainfrom
RUKAYAT-CODER:wave-issue-339-vite-fix
Open

fix(vite): add react / react-dom to library build optimizeDeps (#339)#385
RUKAYAT-CODER wants to merge 1 commit into
Sorokit:mainfrom
RUKAYAT-CODER:wave-issue-339-vite-fix

Conversation

@RUKAYAT-CODER

Copy link
Copy Markdown

Summary

Extends optimizeDeps.include in vite.lib.config.ts to cover react and react-dom alongside the existing sorokit-core and @creit.tech/stellar-wallets-kit entries. Issue #339's three flagged gaps:

  • source maps: already build.sourcemap: true
  • no minify on library: already build.minify: false
  • optimizeDeps for large peer packages: extended to include react and react-dom

Why react / react-dom

react and react-dom are listed as peer dependencies in package.json and are pre-bundled lazily by Vite by default. Adding them explicitly:

  • eliminates the cost of pre-bundling on first cold start when downstream apps import the library in dev mode, and
  • guarantees the same pre-bundled versions regardless of the consumer's local hooks version.

Notes

  • Only vite.lib.config.ts was modified — main vite.config.ts is unchanged because the library build is the one that ships to consumers.
  • No .d.ts, no rollup config, no entry change; the diff is +4 -0.
  • Verified tsconfig + dts plugin are untouched.

Closes #339

…it#339)

vite.lib.config.ts had optimizeDeps.include hard-coded to sorokit-core + @creit.tech/stellar-wallets-kit only. Issue Sorokit#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 Sorokit#339
@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@RUKAYAT-CODER Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(vite): no source maps for library build, no optimizeDeps for large peer packages, build minifies library code

1 participant