Gulp plugin to read vinyl file contents.
npm install --save-dev gulp-read
Basically whenever you can get away with using
read:false at the beginning of a stream, but you still need the file contents at a later stage. Here's what a typical example might look like:
var gulp = ;var changed = ;var read = ;var imagemin = ;var remember = ;gulp;
In the above we don't have to read file contents initially since all
gulp-changed cares about is the last modification date of each file.
After the unchanged files have been removed from the stream the contents of the remaining files are then read by
gulp-read so they can be processed by
In effect we never have to read the contents of files that haven't changed which saves time and speeds up the build.
Reads the contents for each vinyl file from disk.
buffer: Whether or not the file contents should be a
Buffer. Setting this to
file.contentsa stream. (Default:
force: Whether or not to reread file contents if they already exist. (Default:
stripBOM: Whether or not to strip the BOM from file contents. (Default: