blog/lib/tasks/svg.ts

12 lines
398 B
TypeScript

import { lastValueFrom, tap } from "rxjs";
import { dest, fromGlob } from "../rx-utils.ts";
import { mergeMap } from "rxjs";
// SVG `use` has no way of allowing cross-origin, so we need to keep them with the HTML files.
export const svg = async () => {
await lastValueFrom(
fromGlob("src/*.svg")
.pipe(tap((f) => (f.path = f.basename!)), mergeMap(dest("dist"))),
);
};