What does a `workspace:` prefix in a package.json 'dependencies' value mean?

Viewed 2476

Where can I learn more about what is workspace: prefix in version number?

For example, in Babel:

  "dependencies": {
    "@babel/helper-plugin-utils": "workspace:^7.13.0",

source

2 Answers

This is a feature of yarn 2.x. You can read more about this in the yarn documentation at https://yarnpkg.com/features/workspaces#workspace-ranges-workspace As a snippet:

For those use cases, Yarn now supports a new resolution protocol starting from the v2: workspace:. When this protocol is used Yarn will refuse to resolve to anything else than a local workspace. This range protocol has two flavors:

  • If a semver range, it will select the workspace matching the specified version.
  • If a project-relative path, it will select the workspace that match this path (experimental).

you could check about this dependency via using this command

yarn why <dependency-name>
Related