Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable hmr when explicitly disabled in vite config #913

Merged
merged 3 commits into from
May 24, 2024

Conversation

dominikg
Copy link
Member

improvement coming from discussion in #909

@dominikg
Copy link
Member Author

one caveat is for testsuites that actually do test hmr behavior with vitest, you have to explicitly set compilerOptions.hmr = true.

these suites are almost guaranteed to be our own or those of other tooling devs very close to us. Users would almost never make custom hmr things that need testing this way.

@dominikg dominikg changed the title feat: disable hmr when running in vitest by default fix: disable hmr when explicitly disabled in vite config May 24, 2024
@dominikg
Copy link
Member Author

caveat mentioned previously no longer applies. vitest sets server.hmr to false so we don't have to do anything.

@dominikg dominikg merged commit f7409c8 into main May 24, 2024
6 checks passed
@dominikg dominikg deleted the feat/disable-hmr-for-vitest branch May 24, 2024 10:00
@github-actions github-actions bot mentioned this pull request May 24, 2024
dominikg added a commit that referenced this pull request May 25, 2024
* feat: disable hmr when running in vitest by default

* refactor: use vite server.hmr config instead that is set by vitest

* fix: enforce hmr false, update changeset

(cherry picked from commit f7409c8)
dominikg added a commit that referenced this pull request May 29, 2024
* fix: disable hmr when explicitly disabled in vite config (#913)

* feat: disable hmr when running in vitest by default

* refactor: use vite server.hmr config instead that is set by vitest

* fix: enforce hmr false, update changeset

(cherry picked from commit f7409c8)

* fix: ensure vite config is only resolved once in lazy init of vitePreprocess (#912)

* fix: ensure vite config is only resolved once

* fix: add back inlined function to please ts

(cherry picked from commit 1211f97)

* fix: remove extraneous checks for viteConfig.server
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