vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
  • Attribute Selectors
  • Combinators
  • ID Selectors
  • Security Insights
    • Overview
    • :attr()
    • :has()
    • :dist()
    • :host()
    • :is()
    • :not()
    • :outdated()
    • :published()
    • :semver()
    • :spec()
    • :path()
    • :type()
    • :diff()
    • :hostname()
    • :registry()
  • Syntax
  • Examples
  • Match all workspace packages
  • Match a specific path
  • Match with glob patterns
  • What gets selected
  • Combining with other selectors
  • See also
  1. Client
  2. /
  3. Selectors
  4. /
  5. Pseudo-classes
  6. /
  7. :path()

:path()

The :path() pseudo-class matches workspace and file packages based on their file path relative to the project root. Patterns use glob syntax and must be quoted strings.

Syntax

Text
:path("<glob>")

Examples

Match all workspace packages

Terminal
$ vlt query ':path("*")'

Match a specific path

Terminal
$ vlt query ':path("./packages/foo")'

Match with glob patterns

Terminal
$ vlt query ':path("packages/**")'

What gets selected

Given a monorepo:

Text
my-monorepo/
├── packages/
│   ├── core/           ← workspace
│   ├── utils/          ← workspace
│   └── cli/            ← workspace
└── apps/
    └── web/            ← workspace
QuerySelected
:path("*")core, utils, cli, web
:path("packages/**")core, utils, cli
:path("apps/**")web
:path("./packages/core")core

Combining with other selectors

Find workspaces in packages/ that have changed since main:

Terminal
$ vlt query ':path("packages/**"):diff(main)'

See also

  • :workspace — match all workspace packages
  • :type() — match by package type
  • :diff() — match by changed files

Previous:spec()Next:type()

On this page

  • Syntax
  • Examples
  • Match all workspace packages
  • Match a specific path
  • Match with glob patterns
  • What gets selected
  • Combining with other selectors
  • See also
Edit this page

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now