From 9faac4bdd4c38e2c315ee29d244276017074bc5b Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Fri, 20 Oct 2023 23:51:52 +0200 Subject: [PATCH] fix noop overwrite image service regression 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 000000000000..67e30b8db4db --- /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 5485794c5769..30f3314900a3 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -235,16 +235,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; },