Skip to content

Commit 699fd28

Browse files
committedJul 9, 2024
Update docs re. shared/isolated workspaces
1 parent 2c24678 commit 699fd28

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed
 

‎packages/docs/src/content/docs/guides/performance.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ Also see [configuring project files][1].
5656

5757
Knip shares files from separate workspaces if the configuration in
5858
`tsconfig.json` allows this. This reduces memory consumption and run duration.
59-
The relevant compiler options are `baseUrl` and `paths`, and a workspace is
60-
shared if the following is true:
61-
62-
- The `compilerOptions.baseUrl` is not set explicitly
63-
- There are no conflicting keys in `compilerOptions.paths`
59+
Relevant compiler options include `baseUrl`, `paths` and `moduleResolution`.
6460

6561
With the `--debug` flag you can see how many programs Knip uses. Look for
6662
messages like this:
@@ -81,6 +77,9 @@ The first number in `P1/1` is the number of the program, the second number
8177
indicates additional entry files were found in the previous round so it does
8278
another round of analysis on those files.
8379

80+
Use [--isolate-workspaces](../reference/cli.md#--isolate-workspaces) to disable
81+
this behavior.
82+
8483
## findReferences
8584

8685
The `findReferences` function (from the TypeScript Language Service) is invoked

‎packages/docs/src/content/docs/reference/cli.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,14 @@ Also see [external libs][8].
152152

153153
### `--isolate-workspaces`
154154

155-
By default, Knip optimizes performance by adding eligible workspaces to existing
155+
By default, Knip optimizes performance using
156+
[workspace sharing](../guides/performance.md#workspace-sharing) to existing
156157
TypeScript programs, based on the compatibility of their `compilerOptions`. Use
157158
this flag to disable this behavior and create one program per workspace.
158159

159-
You can see the behavior in action in [debug mode][9]. Look for messages like
160-
this:
161-
162-
```sh
163-
[*] Installed 4 programs for 18 workspaces
164-
...
165-
[*] Analyzing used resolved files [P1/1] (78)
166-
```
160+
Usually this setting isn't necessary, but more of an escape hatch in rare cases
161+
with memory usage issues or incompatible `compilerOptions` across workspaces.
162+
Also useful during troubleshooting.
167163

168164
## Modes
169165

0 commit comments

Comments
 (0)
Please sign in to comment.