当前位置: 首页 > 文档资料 > Yarn 中文文档 >

yarn workspaces

优质
小牛编辑
138浏览
2023-12-01

Show information about your workspaces.

What is a workspace?

To learn more about workspaces, check these links:

Commands

yarn workspaces info

This command will display the workspace dependency tree of your current project.

yarn workspaces info
yarn workspaces vx.x.x
{ "create-subscription": {
    "location": "packages/create-subscription",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  },
  ...
  "react-noop-renderer": {
    "location": "packages/react-noop-renderer",
    "workspaceDependencies": [
      "react-reconciler"
    ],
    "mismatchedWorkspaceDependencies": []
  },
  "react-reconciler": {
    "location": "packages/react-reconciler",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  }, ... }
yarn workspaces run <command>

This will run the chosen Yarn command in each workspace.

yarn workspaces run test

This will invoke the test script for each workspace.

This will also pass forward flags and can be useful for CI processes.

yarn workspaces run test --ci