Skip to content

@nx/vite/plugin doesn't allow to ignore root vitest config #32471

@Arilas

Description

@Arilas

Current Behavior

Vitest deprecated vitest.workspace file, and now propose to use projects field in the top vitest.config file.
So with current approach Nx Plugin treats that there's a test target in the root project and calls it, which results in re-running the whole test suite w/o Nx cache. This is not optimal.

Expected Behavior

Nx plugin ignores root vitest config when he see the projects field

GitHub Repo

No response

Steps to Reproduce

  1. Create a Mono-repo with Vitest
  2. Create separate vitest.config files for each project in mono-repo
  3. Create a root vitest.config file for IDE integration which has projects field
  4. Check the graph and observe that there's a test target on the root project

Nx Report

Node           : 22.14.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 4.7.0

nx (global)        : 21.0.3
nx                 : 21.4.0
@nx/js             : 21.4.0
@nx/jest           : 21.4.0
@nx/eslint         : 21.4.0
@nx/workspace      : 21.4.0
@nx/cypress        : 21.4.0
@nx/devkit         : 21.4.0
@nx/eslint-plugin  : 21.4.0
@nx/plugin         : 21.4.0
@nx/storybook      : 21.4.0
@nx/vite           : 21.4.0
typescript         : 5.9.2
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/vite/plugin
---------------------------------------
Cache Usage: 279.20 MB / 46.04 GB

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions