From 8c3d4a859aec0b94cabd14cc56b5bf3e5e973e36 Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Wed, 25 Oct 2023 22:01:43 +0200 Subject: [PATCH] fix noop overwrite image service regression (#8880) Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> --- .changeset/witty-waves-rhyme.md | 5 +++++ packages/astro/src/integrations/index.ts | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 .changeset/witty-waves-rhyme.md diff --git a/.changeset/witty-waves-rhyme.md b/.changeset/witty-waves-rhyme.md new file mode 100644 index 0000000000..67e30b8db4 --- /dev/null +++ b/.changeset/witty-waves-rhyme.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Moves the logic for overriding the image service out of core and into adapters. Also fixes a regression where a valid `astro:assets` image service configuration could be overridden. diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 268721025f..4c527cea3b 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -238,16 +238,6 @@ export async function runHookConfigDone({ ); } } - if (!validationResult.assets) { - logger.warn( - 'astro', - `The selected adapter ${adapter.name} does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice` - ); - settings.config.image.service = { - entrypoint: 'astro/assets/services/noop', - config: {}, - }; - } } settings.adapter = adapter; },