blog/lib/tasks/images.ts

14 lines
419 B
TypeScript
Raw Normal View History

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