Skip to content

server options are not working in workspace (monorepo) #4539

@hironytic

Description

@hironytic

Describe the bug

When using vitest with workspace (monorepo), server options in each vite.config.js are not working.
I just noticed whole test option is passed to ViteNodeServer as a server option. I'll give it a try to submit a PR for this issue.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-3x8m8p

This is a monorepo project that has one workspace package pkg-x which uses server.deps.inline option in its vite.config.js. -- I was copy the code from repro of #3862.

When you run vitest run on packages/pkg-x/, it pass the tests. But when you run vitest run on project's root directory, it fails because server.deps.inline option is not working.

This is not only server.deps.inline, but all server options are not working. Uncomment the server.debug.dumpModules option and run vitest run on project's root directory, dbg directory will not be created.

System Info

System:
  OS: Linux 5.0 undefined
  CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 18.18.0 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 9.4.2 - /usr/local/bin/npm
  pnpm: 8.10.0 - /usr/local/bin/pnpm
npmPackages:
  @vitest/ui: ^1.0.0-beta.5 => 1.0.0-beta.5 
  vitest: ^1.0.0-beta.5 => 1.0.0-beta.5

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions