From bb0b2da6c0275dd8c9eda894452ce45b2e8c4c51 Mon Sep 17 00:00:00 2001 From: Behnam Mohammadi Date: Tue, 31 Aug 2021 09:53:16 +0430 Subject: [PATCH] fix(docs): add note about workspace script order PR-URL: https://github.com/npm/cli/pull/3699 Credit: @behnammodi Close: #3699 Reviewed-by: @wraithgar --- docs/content/using-npm/workspaces.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md index ae834c0cc7e22..baf84f543f017 100644 --- a/docs/content/using-npm/workspaces.md +++ b/docs/content/using-npm/workspaces.md @@ -176,6 +176,22 @@ npm run test --workspaces Will run the `test` script in both `./packages/a` and `./packages/b`. +Commands will be run in each workspace in the order they appear in your `package.json` + +``` +{ + "workspaces": [ "packages/a", "packages/b" ] +} +``` + +Order of run is different with: + +``` +{ + "workspaces": [ "packages/b", "packages/a" ] +} +``` + ### Ignoring missing scripts It is not required for all of the workspaces to implement scripts run with the `npm run` command.