Skip to content

fix: update HMR condition to exclude test mode - #307

Open
Jungzl wants to merge 2 commits into
solidjs:mainfrom
Jungzl:fix/test
Open

fix: update HMR condition to exclude test mode#307
Jungzl wants to merge 2 commits into
solidjs:mainfrom
Jungzl:fix/test

Conversation

@Jungzl

@Jungzl Jungzl commented Aug 13, 2026

Copy link
Copy Markdown

Disable HMR injection in test mode.

This plugin previously injected solid-refresh HMR code into every transformed module when running vitest. The injected if (import.meta.hot) branch does not exist in the source, which made coverage reports (e.g. vitest run --coverage) show branches/lines that do not match the source.

Although we can pass { hot: false } to escape the situation, it's better to bypass all test scenarios by default.

Test mode now skips HMR injection so coverage mappings align with the source.

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e67618

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

This PR includes changesets to release 1 package
Name Type
vite-plugin-solid 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

@brenelz

brenelz commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Needs a changeset

@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite-plugin-solid@307

commit: 784ceef

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.

2 participants