Skip to content

@capgo/capacitor-patch

Apply vetted fixes to Capacitor core packages, the CLI, plugins, and native projects during sync and update hooks.

@capgo/capacitor-patch is a hook-only Capacitor package that applies selected patch files whenever Capacitor runs sync or update.

It is built for fixes that are useful before they land in an official Capacitor release. The bundled catalog tracks external upstream Capacitor PRs mirrored by Capacitor+ sync/upstream-pr-* branches.

Capacitor packages

Patch @capacitor/core, @capacitor/android, @capacitor/ios, and third-party Capacitor plugins under node_modules.

Capacitor CLI

Patch shipped CLI JavaScript files. When a CLI patch is applied, the next cap command uses the patched code.

Native projects

Apply generated Android or iOS project patches after cap sync or cap update.

Safe selection

Version ranges, idempotency checks, and strict mode help prevent stale patches from applying silently.

Patches are opt-in by default. List the shipped catalog, pick the patch IDs your app needs, and add them to plugins.CapacitorPatch.patches.

Each catalog entry includes:

  • a stable patch ID
  • the target package or native project phase
  • supported version range
  • the upstream Capacitor PR
  • the matching Capacitor+ sync branch
  • the patch file shipped with the package

Use @capgo/capacitor-patch when:

  • a Capacitor fix exists upstream but has not shipped yet
  • your app needs the fix without maintaining local patch scripts
  • you want patches to re-apply after every Capacitor sync/update
  • you need a team-readable catalog of the fixes your app depends on

For a full catalog and contribution guide, see the capacitor-patch repository.