Skip to content

Commit fe440b3

Browse files
committed
docs: document v10.8 changes
1 parent 98d2a71 commit fe440b3

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/cli/add.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ pnpm's default semver range operator.
196196
Using `--save-peer` will add one or more packages to `peerDependencies` and
197197
install them as dev dependencies.
198198

199+
### --config
200+
201+
Added in: v10.8.0
202+
203+
Save the dependency to [configDependencies](config-dependencies.md).
204+
199205
### --ignore-workspace-root-check
200206

201207
Adding a new dependency to the root workspace package fails, unless the

docs/pnpmfile.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@ reads the `package.json` of the package from the package's archive, which is not
8181
affected by the hook. In order to ignore a package's build, use the
8282
[neverBuiltDependencies](settings.md#neverbuiltdependencies) field.
8383

84+
### `hooks.updateConfig(config): config | Promise<config>`
85+
86+
Added in: v10.8.0
87+
88+
Allows you to modify the configuration settings used by pnpm. This hook is most useful when paired with [configDependencies](config-dependencies), allowing you to share and reuse settings across different Git repositories.
89+
90+
For example, [@pnpm/better-defaults](https://github.com/pnpm/better-defaults) uses the `updateConfig` hook to apply a curated set of recommended settings.
91+
92+
#### Usage example
93+
94+
```js title=".pnpmfile.cjs"
95+
module.exports = {
96+
hooks: {
97+
updateConfig (config) {
98+
return Object.assign(config, {
99+
enablePrePostScripts: false,
100+
optimisticRepeatInstall: true,
101+
resolutionMode: 'lowest-direct',
102+
verifyDepsBeforeRun: 'install',
103+
})
104+
}
105+
}
106+
}
107+
```
108+
84109
### `hooks.afterAllResolved(lockfile, context): lockfile | Promise<lockfile>`
85110

86111
Allows you to mutate the lockfile output before it is serialized.

0 commit comments

Comments
 (0)