Skip to content

Regression: Can no longer exclude folder from workspace #6499

@ottomated

Description

@ottomated

Describe the bug

My workspace looks like this:

import { defineWorkspace } from 'vitest/config';

export default defineWorkspace([
  'sites/*',
  'packages/*',
  '!packages/tests',
  'apps/*',
]);

As of 2.1.1, it throws this error: Error: Workspace config file "vitest.workspace.ts" references a non-existing file or a directory: .../!packages/tests

Reproduction

should not need reproduction

System Info

System:
    OS: Linux 6.9 Fedora Linux 40 (Forty)
    CPU: (24) x64 AMD Ryzen 9 7900 12-Core Processor
    Memory: 23.57 GB / 30.49 GB
    Container: Yes
    Shell: 3.7.0 - /bin/fish
  Binaries:
    Node: 20.17.0 - ~/.volta/tools/image/node/20.17.0/bin/node
    Yarn: 4.1.1 - ~/.volta/tools/image/yarn/4.1.1/bin/yarn
    npm: 10.8.2 - ~/.volta/tools/image/node/20.17.0/bin/npm
    pnpm: 9.10.0 - ~/.volta/bin/pnpm
    bun: 1.1.26 - ~/.bun/bin/bun
  Browsers:
    Chrome: 128.0.6613.119
  npmPackages:
    vitest: ^2.1.1 => 2.1.1

Used Package Manager

pnpm

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