Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/content/tools/pub/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,32 @@ To use pub workspaces, all your workspace packages (but not your dependencies)
must have an SDK version constraint of `^3.6.0` or higher.
:::

## Glob pattern support in workspaces

Starting with Dart 3.11.0, the `workspace` entry supports glob patterns to automatically include packages:

```yaml
workspace:
- packages/*
```

This includes all subdirectories in `packages/` that contain a `pubspec.yaml` file, eliminating the need to manually list each package. This is especially useful for large or frequently growing monorepos.

Instead of:

```yaml
workspace:
- packages/shared
- packages/client_package
- packages/server_package
```

You can use a glob pattern that automatically picks up new packages.

:::note
Glob pattern support requires Dart 3.11.0 or later. If you use an earlier version, use explicit paths instead.
:::

<a name='stray-files'></a>
## Stray files

Expand Down