You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pnpmfile.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,43 @@ module.exports = {
137
137
There are none - anything that can be done with the lockfile can be modified via
138
138
this function, and you can even extend the lockfile's functionality.
139
139
140
+
### `hooks.preResolution(options): Promise<void>`
141
+
142
+
This hook is executed after reading and parsing the lockfiles of the project, but before resolving dependencies. It allows modifications to the lockfile objects.
143
+
144
+
#### Arguments
145
+
146
+
*`options.existsCurrentLockfile` - A boolean that is true if the lockfile at `node_modules/.pnpm/lock.yaml` exists.
147
+
*`options.currentLockfile` - The lockfile object from `node_modules/.pnpm/lock.yaml`.
148
+
*`options.existsNonEmptyWantedLockfile` - A boolean that is true if the lockfile at `pnpm-lock.yaml` exists.
149
+
*`options.wantedLockfile` - The lockfile object from `pnpm-lock.yaml`.
150
+
*`options.lockfileDir` - The directory where the wanted lockfile is found.
151
+
*`options.storeDir` - The location of the store directory.
152
+
*`options.registries` - A map of scopes to registry URLs.
This hook allows to change how packages are written to `node_modules`. The return value is optional and states what method was used for importing the dependency, e.g.: clone, hardlink.
157
+
158
+
#### Arguments
159
+
160
+
*`destinationDir` - The destination directory where the package should be written.
161
+
*`options.disableRelinkLocalDirDeps`
162
+
*`options.filesMap`
163
+
*`options.force`
164
+
*`options.resolvedFrom`
165
+
*`options.keepModulesDir`
166
+
167
+
### `hooks.fetchers`
168
+
169
+
This hook allows to override the fetchers that are used for different types of dependencies. It is an object that may have the following fields:
0 commit comments