Open AlexRiedler opened 10 years ago
I'm not really sure how to go about fixing this. I'm thinking that if you have that many files running through gulp-rev-replace, it might be worth rethinking how your gulpfile is structured?
@jamesknelson its actually a little more interesting then that; rev() requires the file to be read (to compute the hash)... so your actually caching the entire file's contents as well (and if you have a lot of large images for instance).
Ah I see, that kind of makes sense then. I'd be happy to merge a request if you can fix the issue, although seeing I'm not having the problem myself, it would be rather difficult to test.
Due to caching of files (and their contents) it has to contain the entire streams of all the files that will need to be replaced; This results sometimes in building up a large amount of memory which sometimes makes the process quit for stack-overflow style reasons.
I am not sure if there is a good way to fix this (considering you would need all rev'd stream separate from the replacement stream; just an idea though).
Maybe gulp-rev-replace should take two streams as input, and product the modified streams as output instead? or support both?