fix: add starknet code splitting to reduce bundle size #11582
Merged
+1
−0
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.
Description
PR #11552 added
@avnu/avnu-sdkfor Starknet token swaps, which pulled in the heavystarknetSDK. This increased the main source map from ~24 MB to 26.7 MB, exceeding Cloudflare Pages' 26.2 MB file limit and breaking CI deploys.This PR adds starknet dependencies to Vite's
manualChunksconfiguration, splitting them into a separate chunk following the existing pattern for other heavy dependencies like@solana,@ledgerhq, etc.Result:
main-*.js.mapstarknet-*.js.mapIssue (if applicable)
Fixes CI deploy failures on develop branch.
Risk
Low risk - this only affects Vite's chunk splitting configuration. The same code is delivered to users, just in a separate chunk file. This follows the established pattern already used for Solana, Ledger, and other heavy dependencies.
None - this is a build configuration change only.
Testing
A quick app spot check around trades would not go a stray!
Engineering
yarn build:webstarknet-*.jschunk exists inbuild/assets/.mapfile exceeds 26.2 MB:find build/assets -name '*.map' -exec ls -lh {} \; | sort -hr -k5 | head -5Operations
This is a build infrastructure fix with no user-facing changes.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.