patch-package
patch-package copied to clipboard
diff in a minified file is hard to read
Of course the diff format used works line-based, as that's the norm, git etc. also use that. Unfortunately many libraries are minified upon publish, which means that when you import the file, and a patch needs to be made, that patch must be in the minified version. As soon as the line changed is more than a couple hundred lines, tools like vscode and GitHub will no longer highlight what's the exact change made, and will make it harder to evaluate what changed.
Is there some patch format that is suitable for more granular patches, maybe character or character group-based?
I've had the same issue. Maybe the simplest fix would be to be able to apply some kind of a transformation (e.g., Prettier) to the file before creating/applying the patch? That way the patch could be much smaller, but the minified output would be lost.
Another issue is that in minified files the variable names will mostly be random