remove avif support
This commit is contained in:
parent
a5109e1b20
commit
1eba3a92b2
1 changed files with 1 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ export default class ImageOptimization extends Plugin {
|
||||||
build: undefined;
|
build: undefined;
|
||||||
|
|
||||||
name = "image-optimization";
|
name = "image-optimization";
|
||||||
rewriteTriggers = ["png", "gif", "jpg", "jpeg", "webp", "avif"];
|
rewriteTriggers = ["png", "gif", "jpg", "jpeg", "webp"];
|
||||||
renameTo = "keep";
|
renameTo = "keep";
|
||||||
isBinary = true;
|
isBinary = true;
|
||||||
longLasting = false;
|
longLasting = false;
|
||||||
|
|
@ -25,9 +25,6 @@ export default class ImageOptimization extends Plugin {
|
||||||
if (type == "webp") {
|
if (type == "webp") {
|
||||||
data = await sharp(file).webp({ lossless: true }).toBuffer();
|
data = await sharp(file).webp({ lossless: true }).toBuffer();
|
||||||
}
|
}
|
||||||
if (type == "avif") {
|
|
||||||
data = await sharp(file).avif({ lossless: true }).toBuffer();
|
|
||||||
}
|
|
||||||
if (type == "jpg" || type == "jpeg") {
|
if (type == "jpg" || type == "jpeg") {
|
||||||
data = await sharp(file).jpeg({ quality: 100 }).toBuffer();
|
data = await sharp(file).jpeg({ quality: 100 }).toBuffer();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue