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, we need to create a server for every workspace project to resolve the config and have access to the module graph for project.vitenode/project.runner properties.
When the browser mode is enabled, we need a separate Vite server because it shouldn't share the same plugin that the project has and needs special additional handling. We also don't want to mix module graphs of different environments.
To fix this, we need to make some changes.
Remove poolMatchGlob - this makes it possible to run Node.js tests and browser tests in the same project (which is the main reason why we need separate servers). Recommend the workspace instead
Remove environmentMatchGlob - the presence of this requires us to share the module graph between different environments. Recommend the workspace instead
This would guarantee that a single project is responsible for a single environment. With Vite 6, we can even migrate it to inline Vite environments.
Possible problems:
--project filter is applied after all projects are resolved. Ideally, we should have a separation between config resolution and server creation, but Vite currently doesn't allow it (environment API allows it though)
--project filter can be changed dynamically in watch mode. To support this, we would have to keep the configs around, but also close the filtered projects, - a lot of moving parts there. I am not sure it's justifyable to keep this feature.
How does inline workspace look like? What if there is a workspace file? Does it override it?
Describe the bug
Currently, we need to create a server for every workspace project to resolve the config and have access to the module graph for
project.vitenode
/project.runner
properties.When the browser mode is enabled, we need a separate Vite server because it shouldn't share the same plugin that the project has and needs special additional handling. We also don't want to mix module graphs of different environments.
To fix this, we need to make some changes.
poolMatchGlob
- this makes it possible to run Node.js tests and browser tests in the same project (which is the main reason why we need separate servers). Recommend theworkspace
insteadenvironmentMatchGlob
- the presence of this requires us to share the module graph between different environments. Recommend theworkspace
insteadThis would guarantee that a single project is responsible for a single environment. With Vite 6, we can even migrate it to inline Vite environments.
Possible problems:
--project
filter is applied after all projects are resolved. Ideally, we should have a separation between config resolution and server creation, but Vite currently doesn't allow it (environment API allows it though)--project
filter can be changed dynamically in watch mode. To support this, we would have to keep the configs around, but also close the filtered projects, - a lot of moving parts there. I am not sure it's justifyable to keep this feature.Reproduction
https://github.com/vitest-dev/vitest/tree/main/examples/lit
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: