Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.1 KB

PATCHING.md

File metadata and controls

34 lines (23 loc) · 1.1 KB

Patching PresetManager

It is possible to patch node_modules in use by PresetManager. This is particularly useful for Node Pattern Lab 3, which at the time of writing is still in Beta.

Requirements

Installation

  • npm i patch-package --save-dev

Usage

Add the following to your package.json file ins PresetManager:

 "scripts": {
  "postinstall": "patch-package"
 }

Make your changes directly in the node_module you wish to update. After doing your work, simply run npx patch-package package-name to capture your update. For example, you have patched a file in @pattern-lab/core, simply run npx patch-package @pattern-lab/core. This generates a patch directory at the root of PresetManager.

When you run npm install, the patch-package module will run with the postinstall script above, patching your npm package with the source from the patches directory.

Make sure to monitor these patches for any stale patches and prune as projects are updated.