Skip to content

Commit 740ce57

Browse files
authored
docs: add Yarn PnP options describe (#142)
1 parent 83e4000 commit 740ce57

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Rust port of [enhanced-resolve](https://github.com/webpack/enhanced-resolve).
88
- support project references defined `tsconfig.references`
99
- support [template variable ${configDir} for substitution of config files directory path](https://github.com/microsoft/TypeScript/pull/58042)
1010
- supports in-memory file system via the `FileSystem` trait
11+
- supports Yarn's [Plug'n'Play](https://yarnpkg.com/features/pnp)
1112
- contains `tracing` instrumentation
1213

1314
## Usage
@@ -166,12 +167,13 @@ The options are aligned with [enhanced-resolve](https://github.com/webpack/enhan
166167

167168
### Other Options
168169

169-
| Field | Default | Description |
170-
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
171-
| pnpManifest | None | Path to yarn Plug'n'Play manifest file |
172-
| tsconfig | None | TypeScript related config for resolver |
173-
| tsconfig.configFile | | A relative path to the tsconfig file based on `cwd`, or an absolute path of tsconfig file. |
174-
| tsconfig.references | `[]` | - 'auto': inherits from TypeScript config <br/> - `string []`: relative path (based on directory of the referencing tsconfig file) or absolute path of referenced project's tsconfig |
170+
| Field | Default | Description |
171+
|---------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
172+
| tsconfig | None | TypeScript related config for resolver |
173+
| tsconfig.configFile | | A relative path to the tsconfig file based on `cwd`, or an absolute path of tsconfig file. |
174+
| tsconfig.references | `[]` | - 'auto': inherits from TypeScript config <br/> - `string []`: relative path (based on directory of the referencing tsconfig file) or absolute path of referenced project's tsconfig |
175+
| enablePnp | false | Enable Yarn Plug'n'Play support |
176+
| pnpManifest | None | Absolute path to the Yarn Plug'n'Play manifest file; takes effect when PnP is enabled. <br/> - `None`: PnP manifest located in the nearest ancestor directory from every resolving's path; <br/> - `Some(PathBuf)`: Use a specific PnP manifest file. This is useful when enabling PnP with `enableGlobalCache: true`, but users must ensure there are no cross-project requires across Yarn PnP projects. |
175177

176178
In the context of `@rspack/resolver`, the `tsconfig.references` option helps isolate the `paths` configurations of different TypeScript projects.
177179
This ensures that path aliases defined in one TypeScript project do not unintentionally affect the resolving behavior of another.

0 commit comments

Comments
 (0)