From 796619d22be2989c346c4f8b77ecf94eef22331d Mon Sep 17 00:00:00 2001 From: Sebin Nyshkim Date: Tue, 22 Oct 2024 12:51:18 +0200 Subject: [PATCH] feat: :wrench: add compressor config options --- eleventy.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eleventy.config.js b/eleventy.config.js index cdd602f..057b7bb 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -70,6 +70,8 @@ export default async function (eleventyConfig) { extensions: 'html', formats: ['avif', 'webp', 'auto'], widths: [640, 800, 1280, 1920, 2560, 3840, 'auto'], + sharpJpegOptions: { mozjpeg: true, optimiseScans: true, quality: 95 }, + sharpPngOptions: { compressionLevel: 9 }, urlPath: '/img/', outputDir: './public/img/', defaultAttributes: { @@ -112,6 +114,8 @@ export default async function (eleventyConfig) { eleventyConfig.addShortcode('bgimgset', async (src) => { const imgset = await Image(src, { widths: [1920, 2560, 3840], + sharpJpegOptions: { mozjpeg: true, optimiseScans: true, quality: 95 }, + sharpPngOptions: { compressionLevel: 9 }, formats: ['avif', 'webp', 'auto'], urlPath: '/img/', outputDir: './public/img/'