-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
viteOverrides
option in startVitest
doesn't affect browser mode config
#5015
Comments
Interesting usage of a public API 🤔 "viteOverrides" is only applied to the main server, the browser has its own separate server and it doesn't use this option at all (aliases also won't work for example). This is probably a bug, but I am not sure. |
Just in case, I verified that plugin usage with normal As @sheremet-va suggested, I think the issue is more like While thinking about how browser mode server config can be affected by main server config, I thought we can potentially pass
I feel this is inherent limitation of inline config and running multiple vite servers, which actually comes up sometimes in the ecosystem such as remix-run/remix#7990 (Remix was reusing already instantiated plugins in two servers) and also solidjs/solid-start#1198 (I'm not too familiar but solid/vinxi also has multiple servers). So this user's browser mode use case might be difficult to support without tweaking API in some explicit way. |
viteOverrides
option in startVitest
doesn't affect browser mode config
There is a concept of a "core workspace project" in Vitest API. This is a project that is responsible for higher-level features that you cannot have on a workspace level like a global setup or coverage. The browser server is part of a workspace project and is not affected by the |
Describe the bug
When using the experimental "browser mode", the import of custom files is not working although I have added a vite plugin that is telling how this import should be handled.
Importing a file like so works well in non browser mode, but it's not working in browser mode.
Result in this error in browser mode:
Reproduction
https://github.com/Florent-Bouisset/bug-vitest-repo
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: