You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, @vitejs/plugin-vue only checks for the existence of options.devServer (which is a ViteDevServer instance) to decide whether to inject HMR code, regardless of the actual configuration of the server.
Meanwhile, there's a server option that can disable HMR completely:
This causes problems as I'm working on vite-jest.
I need the transpiled code to run in the Node.js environment, which doesn't support import.meta.hot. But because of this bug, I can't disable HMR completely in Vue projects.
Reproduction
N/A
System Info
Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Provide a description in this issue that describes the bug.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Describe the bug
Currently,
@vitejs/plugin-vue
only checks for the existence ofoptions.devServer
(which is aViteDevServer
instance) to decide whether to inject HMR code, regardless of the actual configuration of the server.Meanwhile, there's a server option that can disable HMR completely:
vite/packages/vite/src/node/server/index.ts
Line 74 in e2b3628
and it is respected in the core vite server:
vite/packages/vite/src/node/server/index.ts
Lines 370 to 380 in e2b3628
but never checked in
plugin-vue
:vite/packages/plugin-vue/src/main.ts
Lines 116 to 136 in e2b3628
vite/packages/plugin-vue/src/template.ts
Lines 23 to 27 in e2b3628
This causes problems as I'm working on
vite-jest
.I need the transpiled code to run in the Node.js environment, which doesn't support
import.meta.hot
. But because of this bug, I can't disable HMR completely in Vue projects.Reproduction
N/A
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: pnpm
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: