build: run the lib/replace rules first