diff --git a/articles/gulp-to-rxjs/gulp-to-rxjs.asciidoc b/articles/gulp-to-rxjs/gulp-to-rxjs.asciidoc index 27b84c4..15b9c61 100644 --- a/articles/gulp-to-rxjs/gulp-to-rxjs.asciidoc +++ b/articles/gulp-to-rxjs/gulp-to-rxjs.asciidoc @@ -146,9 +146,17 @@ You can then use `+mergeMap+` to inject this function into our pipeline. Here is [source,ts] ---- import { VFile } from "https://esm.sh/vfile@^6.0.1"; +import { Glob } from "https://esm.sh/glob@^10.4.2"; import { read } from "https://esm.sh/to-vfile@^8.0.0"; +import { from, mergeMap, tap } from "https://esm.sh/rxjs@^7.8.1"; import { dirname, relative, resolve } from "jsr:@std/path@^0.225.2"; +const src = (globs: string | string[]) => + from(new Glob(globs, {})).pipe( + mergeMap((file) => read(resolve(file))), + tap((file) => file.cwd = Deno.cwd()), + ); + const dest = (prefix: string) => async (file: VFile) => { const relativePath = relative(file.cwd, file.path); const finalPath = resolve(prefix, relativePath);