Recursively Run Scripts in All pnpm Workspace Projects

Share this video with your friends

Send Tweet

While its convenient to be able to use filter commands to run scripts without having to cd into package/app folders, it's still a tedious task if you need to run commands in several projects at once.

It's actually very easy to recursively run a script in all projects with pnpm using the -r flag. For example, pnpm run -r build will go through each project in the workspace and attempt to run the build command.