Skip to main content
Version: 9.x

pnpm-workspace.yaml

pnpm-workspace.yaml 定义 workspace 的根目录,使你能够在工作区中包含/排除目录。默认情况下,包含所有子目录的所有包。

¥pnpm-workspace.yaml defines the root of the workspace and enables you to include / exclude directories from the workspace. By default, all packages of all subdirectories are included.

例如:

¥For example:

pnpm-workspace.yaml
packages:
# all packages in direct subdirs of packages/
- 'packages/*'
# all packages in subdirs of components/
- 'components/**'
# exclude packages that are inside test directories
- '!**/test/**'

即使使用自定义位置通配符,根包也始终包含在内。

¥The root package is always included, even when custom location wildcards are used.

目录也在 pnpm-workspace.yaml 文件中定义。详情请参阅 目录

¥Catalogs are also defined in the pnpm-workspace.yaml file. See Catalogs for details.

pnpm-workspace.yaml
packages:
- 'packages/*'

catalog:
chalk: ^4.1.2

catalogs:
react16:
react: ^16.7.0
react-dom: ^16.7.0
react17:
react: ^17.10.0
react-dom: ^17.10.0