Skip to content

fix: dedupe Solid packages in production builds - #439

Open
lxsmnsyc wants to merge 1 commit into
nextfrom
fix/112-dedupe-build
Open

lxsmnsyc wants to merge 1 commit into
nextfrom
fix/112-dedupe-build

Conversation

@lxsmnsyc

Copy link
Copy Markdown
Member

Fixes #112 on next. The fix for main (1.x) is in a separate PR.

Production builds now include one copy of the Solid runtime when a dependency brings its own version. Before, resolve.dedupe was only set for the dev server, so builds could bundle two copies.

Changes

  • resolve.dedupe is now set for every command, not only serve.
  • It covers solid-js, @solidjs/web and @solidjs/signals. Each is added only when the project root can resolve it, as the @solidjs/signals entry already was.
  • optimizeDeps.include stays dev-only.

Testing

  • Reproduced with an app on solid-js rc.14 and a dependency carrying rc.13. The Vite 8 build bundled both copies. With the fix it bundles one.
  • Added a regression test that fails without the fix.
  • vitest run and tsc --noEmit pass. The vite-8, ssr and start-ssr examples build.

🤖 Generated with Claude Code

- resolve.dedupe was only set while serving, so a dependency with its own nested solid-js copy was bundled twice in production.
- Dedupe solid-js, @solidjs/web and @solidjs/signals in every command, for each one the project root can resolve.
- Add a build test with a nested solid-js copy.

Fixes #112

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ff493b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/vite-plugin@439

commit: ff493b9

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