blog/lib/tasks/svg.ts

12 lines
398 B
TypeScript
Raw Normal View History

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