chore: remove unused background assets [no ci]
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 965 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 888 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 240 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 898 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
@@ -1,12 +1,14 @@
|
||||
import { Glob } from "bun";
|
||||
import { file, Glob, write } from "bun";
|
||||
import { rm } from "node:fs/promises";
|
||||
|
||||
const g = new Glob("public/bgassets/*.png");
|
||||
|
||||
for await (const img of g.scan()) {
|
||||
Bun.file(img)
|
||||
file(img)
|
||||
.image()
|
||||
.webp()
|
||||
.buffer()
|
||||
.then((b) => Bun.write(img.replace(".png", ".webp"), b))
|
||||
.then((b) => write(img.replace(".png", ".webp"), b))
|
||||
.then(() => rm(img))
|
||||
.finally(() => console.log(img, "processed."));
|
||||
}
|
||||
|
||||