yarnpkgpatchpatch-package

How to patch-package --include multiple files of the same package


Is it possible to patch-package --include multiple files? I have two files under the same package but they're in different paths. What would be the best way to include only the changes from these 2 files?

yarn patch-package <package-name> --include <file1> <file2>

Solution

  • From the patch-package docs, you can pass a regex to the --include flag. So, including two files can be achieved as follows:

    yarn patch-package <package-name> --include (<file1>|<file2>)