feat: allow loading preResolution, importPackage, and fetchers from local pnpmfile (#9450)
This commit is contained in:
1 parent
7a2d7a18ed
commit
e5c58f093f
2 files changed
+9
-3
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/pnpmfile": minor
|
||||
"pnpm": minor
|
||||
---
|
||||
|
||||
Allow loading the `preResolution`, `importPackage`, and `fetchers` hooks from local pnpmfile.
|
||||
@@ -72,15 +72,15 @@ export function requireHooks (
|
||||
|
||||
// `importPackage`, `preResolution` and `fetchers` can only be defined via a global pnpmfile
|
||||
|
||||
cookedHooks.importPackage = globalHooks.importPackage
|
||||
cookedHooks.importPackage = hooks.importPackage ?? globalHooks.importPackage
|
||||
|
||||
const preResolutionHook = globalHooks.preResolution
|
||||
const preResolutionHook = hooks.preResolution ?? globalHooks.preResolution
|
||||
|
||||
cookedHooks.preResolution = preResolutionHook
|
||||
? (ctx: PreResolutionHookContext) => preResolutionHook(ctx, createPreResolutionHookLogger(prefix))
|
||||
: undefined
|
||||
|
||||
cookedHooks.fetchers = globalHooks.fetchers
|
||||
cookedHooks.fetchers = hooks.fetchers ?? globalHooks.fetchers
|
||||
if (hooks.updateConfig != null) {
|
||||
const updateConfig = hooks.updateConfig
|
||||
cookedHooks.updateConfig = (config) => {
|
||||
|
||||
Reference in new issue
Block a user