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
I'm trying to configure a monorepo workspace project from the root with all config in vitest.workspace.ts. My intent is to run the entire test suite in different environments to verify cross-platform compatibility. I want to configure this in the workspace config directly for more fine grained control instead of using cli options.
The bug is that any browser configuration (no matter which provider is used) fails to resolve module aliases if they are configured from the workspace root. It works if they are configured e.g. via a package specific vitest.config.ts file but not via the workspace root config.
The provided reproduction showcases that in the simplest way possible.
There seems to be a problem with how the vitest server (createVitestServer) is initialized with project config. The server doesn't get the alias config passed to it at all because it appears to only load that from whatever it resolves as configFile in there.
By reading the source code there I managed to find a workaround. By dropping a vitest.aliases.ts file at the workspace root and pointing at that using the extends option for every project, it causes theconfigFile value to be resolved to that shared "alias" file.
That resolves my issue but it still appears to be a bug.
Describe the bug
I'm trying to configure a monorepo workspace project from the root with all config in
vitest.workspace.ts
. My intent is to run the entire test suite in different environments to verify cross-platform compatibility. I want to configure this in the workspace config directly for more fine grained control instead of using cli options.The bug is that any
browser
configuration (no matter which provider is used) fails to resolve module aliases if they are configured from the workspace root. It works if they are configured e.g. via a package specificvitest.config.ts
file but not via the workspace root config.The provided reproduction showcases that in the simplest way possible.
Reproduction
https://github.com/fubhy/vitest-workspace-repro
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: