Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@github.com>2022-07-28 00:15:21 +0300
committerGitHub <noreply@github.com>2022-07-28 00:15:21 +0300
commit4d1d8a9561000064fe765ba31a3ad21832721c59 (patch)
tree7542dafc5385773e566d57fa3820ab8b7f559fb3 /docs
parent62b95a04337661e3fa17093708b57000054442d9 (diff)
docs: describe implicit workspace and prefix configuration (#5221)
* docs: describe implicit workspace and prefix configuration * Update docs/content/using-npm/workspaces.md Co-authored-by: Gar <gar+gh@danger.computer> Co-authored-by: Luke Karrys <luke@lukekarrys.com> Co-authored-by: Gar <gar+gh@danger.computer>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/using-npm/workspaces.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/docs/content/using-npm/workspaces.md b/docs/content/using-npm/workspaces.md
index 82491cd74..5b68ef8ce 100644
--- a/docs/content/using-npm/workspaces.md
+++ b/docs/content/using-npm/workspaces.md
@@ -137,6 +137,8 @@ nested workspaces to be consumed elsewhere.
You can use the `workspace` configuration option to run commands in the context
of a configured workspace.
+Additionally, if your current directory is in a workspace, the `workspace`
+configuration is implicitly set, and `prefix` is set to the root workspace.
Following is a quick example on how to use the `npm run` command in the context
of nested workspaces. For a project containing multiple workspaces, e.g:
@@ -158,7 +160,13 @@ given command in the context of that specific workspace. e.g:
npm run test --workspace=a
```
-This will run the `test` script defined within the
+You could also run the command within the workspace.
+
+```
+cd packages/a && npm run test
+```
+
+Either will run the `test` script defined within the
`./packages/a/package.json` file.
Please note that you can also specify this argument multiple times in the