fix(vite): add react / react-dom to library build optimizeDeps (#339) - #385
Open
RUKAYAT-CODER wants to merge 1 commit into
Open
fix(vite): add react / react-dom to library build optimizeDeps (#339)#385RUKAYAT-CODER wants to merge 1 commit into
RUKAYAT-CODER wants to merge 1 commit into
Conversation
…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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends
optimizeDeps.includeinvite.lib.config.tsto coverreactandreact-domalongside the existingsorokit-coreand@creit.tech/stellar-wallets-kitentries. Issue #339's three flagged gaps:build.sourcemap: true✓build.minify: false✓reactandreact-dom✓Why react / react-dom
reactandreact-domare listed as peer dependencies inpackage.jsonand are pre-bundled lazily by Vite by default. Adding them explicitly:Notes
vite.lib.config.tswas modified — mainvite.config.tsis unchanged because the library build is the one that ships to consumers..d.ts, no rollup config, no entry change; the diff is+4 -0.Closes #339