Describe the bug
In an Astro project, one can use the Netlify Astro adapter with the imageCDN option set to false. This means images will not use Netlify's image CDN.
When using Unpic, Unpic will auto-detect the value of fallbackService if it is omitted from the user config. However, when netlify({ imageCDN: false }) is set, fallbackService is "netlify" instead of "sharp", causing broken images.
To Reproduce
Use the following Astro config on a site with image content:
// @ts-check
import { defineConfig } from "astro/config";
import netlify from "@astrojs/netlify";
import { imageService } from "@unpic/astro/service";
// https://astro.build/config
export default defineConfig({
image: { service: imageService() },
adapter: netlify({ imageCDN: false }),
});
Notice that generated images have paths under /.netlify/..., which assumes that the Netlify image CDN is being used, when it isn't.
Expected behavior
The default fallbackService should be auto-detected as "sharp" instead of "netlify".
Screenshots
N/A
Describe the bug
In an Astro project, one can use the Netlify Astro adapter with the
imageCDNoption set tofalse. This means images will not use Netlify's image CDN.When using Unpic, Unpic will auto-detect the value of
fallbackServiceif it is omitted from the user config. However, whennetlify({ imageCDN: false })is set,fallbackServiceis"netlify"instead of"sharp", causing broken images.To Reproduce
Use the following Astro config on a site with image content:
Notice that generated images have paths under
/.netlify/..., which assumes that the Netlify image CDN is being used, when it isn't.Expected behavior
The default
fallbackServiceshould be auto-detected as"sharp"instead of"netlify".Screenshots
N/A