Wait until the build is complete before streaming

Previously it would instantly pass on the file to the next `.pipe`. With this change, the file won't get passed along until the build finishes. If it fails the file will not get passed.