Updated
This commit is contained in:
parent
ed7f12cac4
commit
8e724b166a
6 changed files with 3 additions and 3 deletions
|
|
@ -26,14 +26,14 @@ import { hideBin } from "yargs/helpers";
|
|||
const avifOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.avif`;
|
||||
const webpOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.webp`;
|
||||
|
||||
const avifBuffer = await sharp(`./src/images/${name}`)
|
||||
const avifBuffer = await sharp(`./src/assets/images/${name}`)
|
||||
.avif({ quality: 60 })
|
||||
.resize(size)
|
||||
.toBuffer();
|
||||
await sharp(avifBuffer).toFile(avifOutputPath);
|
||||
consola.success(`${name} successfully optimized in Avif`);
|
||||
|
||||
const webpBuffer = await sharp(`./src/images/${name}`)
|
||||
const webpBuffer = await sharp(`./src/assets/images/${name}`)
|
||||
.webp({ quality: 75 })
|
||||
.resize(size)
|
||||
.toBuffer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue