You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,18 @@ or `patch` in unixy environments:
143
143
144
144
patch -p1 -i patches/package-name+0.44.2.patch
145
145
146
+
### Dev-only patches
147
+
148
+
If you deploy your package to production (e.g. your package is a server) then any patched `devDependencies` will not be present when patch-package runs in production. It will happily ignore those patch files if the package to be patched is listed directly in the `devDependencies` of your package.json. If it's a transitive dependency patch-package can't detect that it is safe to ignore and will throw an error. To fix this, mark patches for transitive dev dependencies as dev-only by renaming from, e.g.
149
+
150
+
package-name+0.44.0.patch
151
+
152
+
to
153
+
154
+
package-name+0.44.0.dev.patch
155
+
156
+
This will allow those patch files to be safely ignored when `NODE_ENV=production`.
157
+
146
158
## Benefits of patching over forking
147
159
148
160
- Sometimes forks need extra build steps, e.g. with react-native for Android. Forget that noise.
0 commit comments