blog/lib/tasks/images.ts

12 lines
342 B
TypeScript
Raw Normal View History

2024-06-21 21:03:37 +00:00
import hashPaths from "../hash.js";
2024-06-27 01:36:05 +00:00
import { dest, fromGlob } from "../rx-utils.js";
import { mergeMap, tap } from "rxjs";
2024-06-21 21:03:37 +00:00
export const images = () =>
2024-06-27 01:36:05 +00:00
fromGlob("src/*.avif")
2024-06-27 01:28:17 +00:00
.pipe(
tap((f) => (f.path = f.path.substring(4))),
hashPaths("images.manifest"),
)
.forEach(dest("dist/_assets"));