Optimize the build script's replace_tokens target.