Skip to content

Commit b9361e5

Browse files
KSXGitHubzkochan
andauthored
docs: notes for dependencies filtering (#645)
* docs: notes for dependencies filtering Resolves pnpm/pnpm#9147 * create separate section for filter flags --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
1 parent ca8d4fb commit b9361e5

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

docs/cli/install.md

+29-18
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,35 @@ setting to `false`.
2626
| `pnpm i --frozen-lockfile` | `pnpm-lock.yaml` is not updated |
2727
| `pnpm i --lockfile-only` | Only `pnpm-lock.yaml` is updated |
2828

29+
## Options for filtering dependencies
30+
31+
Without a lockfile, pnpm has to create one, and it must be consistent regardless of dependencies
32+
filtering, so running `pnpm install --prod` on a directory without a lockfile would still resolve the
33+
dev dependencies, and it would error if the resolution is unsuccessful. The only exception for this rule
34+
are `link:` dependencies.
35+
36+
Without `--frozen-lockfile`, pnpm will check for outdated information from `file:` dependencies, so
37+
running `pnpm install --prod` without `--frozen-lockfile` on an environment where the target of `file:`
38+
has been removed would error.
39+
40+
### --prod, -P
41+
42+
* Default: **false**
43+
* Type: **Boolean**
44+
45+
If `true`, pnpm will not install any package listed in `devDependencies` and will remove
46+
those insofar they were already installed.
47+
If `false`, pnpm will install all packages listed in `devDependencies` and `dependencies`.
48+
49+
### --dev, -D
50+
51+
Only `devDependencies` are installed and `dependencies` are removed insofar they
52+
were already installed.
53+
54+
### --no-optional
55+
56+
`optionalDependencies` are not installed.
57+
2958
## Options
3059

3160
### --force
@@ -48,24 +77,6 @@ If a package won't be found locally, the installation will fail.
4877
If `true`, staleness checks for cached data will be bypassed, but missing data
4978
will be requested from the server. To force full offline mode, use `--offline`.
5079

51-
### --prod, -P
52-
53-
* Default: **false**
54-
* Type: **Boolean**
55-
56-
If `true`, pnpm will not install any package listed in `devDependencies` and will remove
57-
those insofar they were already installed.
58-
If `false`, pnpm will install all packages listed in `devDependencies` and `dependencies`.
59-
60-
### --dev, -D
61-
62-
Only `devDependencies` are installed and `dependencies` are removed insofar they
63-
were already installed.
64-
65-
### --no-optional
66-
67-
`optionalDependencies` are not installed.
68-
6980
### --no-lockfile
7081

7182
Don't read or generate a `pnpm-lock.yaml` file.

0 commit comments

Comments
 (0)