fix: use esm import for @pnpm/patch-package in @pnpm/apply-patch (#10191)

This commit is contained in:
Brandon Cheng
2025-11-16 17:35:25 -05:00
committed by GitHub
parent 23b139a10f
commit a0e3a21a93
3 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/patching.apply-patch": patch
---
Import `@pnpm/patch-package/dist/applyPatches` using `.js` extension for ESM compatibility. This fixes an `ERR_MODULE_NOT_FOUND` error.

View File

@@ -113,7 +113,7 @@ declare module 'yaml-tag' {
export = anything
}
declare module '@pnpm/patch-package/dist/applyPatches' {
declare module '@pnpm/patch-package/dist/applyPatches.js' {
export function applyPatch (opts: any): boolean
}

View File

@@ -1,5 +1,5 @@
import { PnpmError } from '@pnpm/error'
import { applyPatch } from '@pnpm/patch-package/dist/applyPatches'
import { applyPatch } from '@pnpm/patch-package/dist/applyPatches.js'
import { globalWarn } from '@pnpm/logger'
export interface ApplyPatchToDirOpts {