The `.pipe()` method has deprecated in Gulp/Vinyl, but what it the alternative?

84 Views Asked by At

    /**
     * @deprecated This method was removed in v2.0.
     * If file.contents is a Buffer, it will write it to the stream.
     * If file.contents is a Stream, it will pipe it to the stream.
     * If file.contents is null, it will do nothing.
     */
    pipe<T extends NodeJS.WritableStream>(
        stream: T,
        opts?: {
            /**
             * If false, the destination stream will not be ended (same as node core).
             */
            end?: boolean | undefined;
        }
    ): T; } 

@types/vinyl v2.0.7

Because of it, many previously valid Gulp pipelines has become alerted. No need to read the code in the below picture - it actual only for my project, I just want to show which troubles this deprecation could cause:

enter image description here

If I must to paste the code sample, just below one will be enough for the reproduction:

Gulp.src([]).pipe();

Deprecated: This method was removed in v2.0. If file.contents is a Buffer, it will write it to the stream. If file.contents is a Stream, it will pipe it to the stream. If file.contents is null, it will do nothing

Fine, what we should to do now? I don't think that the arbitrary pipeline could be replaced with Gulp series and parallels.

0

There are 0 best solutions below