8000 Split npm dependencies into a vendor chunk by rleibman · Pull Request #13 · rleibman/chuti · GitHub
[go: up one dir, main page]

Skip to content

Split npm dependencies into a vendor chunk - #13

Merged
rleibman merged 1 commit into
mainfrom
vite-vendor-chunk
Sep 14, 2026
Merged

rleibman merged 1 commit into
mainfrom
vite-vendor-chunk

Conversation

@rleibman
Copy link
Copy Markdown
Owner

Changes to web/vite.config.js:

  • Vendor chunk: manualChunks sends everything from node_modules to a vendor chunk. Before, the whole app was one 3.5 MB chunk, so any Scala change invalidated React and semantic-ui-react along with it. Vendor code now changes only when package.json does, so browsers keep it cached.
  • chunkSizeWarningLimit: 3500: the default of 500 kB always fires for a Scala.js app. With the limit just above the current app chunk, the warning only fires again if the bundle grows materially.
  • Comment: the one about "use client" directives no longer mentions MUI specifically.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WLJ6KPxFVco7fXsDVT2FhF

Everything landed in one 3.5 MB chunk, so any Scala change invalidated React and semantic-ui-react along with it,
and the browser re-downloaded all of it for a one-line edit. npm dependencies now go to a `vendor` chunk, which
only changes when package.json does.

The chunk size warning limit goes from the default 500 kB, which a Scala.js app always exceeds, to just above the
current app chunk, so the warning fires again only if the bundle grows materially.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WLJ6KPxFVco7fXsDVT2FhF
@rleibman
rleibman merged commit d4c91ee into main Sep 14, 2026
1 check failed
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.

1 participant

0