bun-patch
Patch installed packages locally
TLDR
SYNOPSIS
bun patch [options] package-name
DESCRIPTION
bun patch allows you to persistently patch node_modules in a maintainable, git-friendly way. It extracts a package for editing, and after making changes, --commit creates a .patch file that is applied on future installs.Patch files are stored in a patches directory and tracked via "patchedDependencies" in package.json. They can be committed to your repository and reused across multiple installs, projects, and machines.You can supply a package name, a precise version (if multiple versions are installed), or the path to the package in node_modules.
PARAMETERS
--commit path-or-pkg
Generate a .patch file from modifications. Accepts package name, name@version, or path to patched package.--patches-dir dir
Directory to store patch files (only with --commit). Default: patches.-p, --production
Don't install devDependencies--frozen-lockfile
Disallow changes to the lockfile--dry-run
Don't install anything, only show what would be done--ignore-scripts
Skip lifecycle scripts in the project's package.json-f, --force
Always request the latest versions from the registry and reinstall all dependencies--verbose
Enable verbose logging output
CAVEATS
Patches are stored in a patches directory and must be committed to version control. Patches may break when the package is updated.
SEE ALSO
bun(1), bun-install(1), bun-add(1), bun-update(1)
