diff options
Diffstat (limited to 'packages/integrations')
6 files changed, 1 insertions, 39 deletions
diff --git a/packages/integrations/node/src/index.ts b/packages/integrations/node/src/index.ts index 36d9ee30f..60f489c79 100644 --- a/packages/integrations/node/src/index.ts +++ b/packages/integrations/node/src/index.ts @@ -16,7 +16,6 @@ export function getAdapter(options: Options): AstroAdapter { assets: { supportKind: 'stable', isSharpCompatible: true, - isSquooshCompatible: true, }, i18nDomains: 'experimental', envGetSecret: 'experimental', diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index d28fc46e9..5adb8c68f 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -26,7 +26,6 @@ "./speed-insights": "./dist/speed-insights.js", "./build-image-service": "./dist/image/build-service.js", "./dev-image-service": "./dist/image/dev-service.js", - "./squoosh-dev-service": "./dist/image/squoosh-dev-service.js", "./package.json": "./package.json" }, "typesVersions": { diff --git a/packages/integrations/vercel/src/image/shared.ts b/packages/integrations/vercel/src/image/shared.ts index da9342f29..0a2575985 100644 --- a/packages/integrations/vercel/src/image/shared.ts +++ b/packages/integrations/vercel/src/image/shared.ts @@ -13,7 +13,7 @@ export function isESMImportedImage(src: ImageMetadata | string): src is ImageMet return typeof src === 'object'; } -export type DevImageService = 'sharp' | 'squoosh' | (string & {}); +export type DevImageService = 'sharp' | (string & {}); // https://vercel.com/docs/build-output-api/v3/configuration#images type ImageFormat = 'image/avif' | 'image/webp'; @@ -76,9 +76,6 @@ export function getAstroImageConfig( case 'sharp': devService = '@astrojs/vercel/dev-image-service'; break; - case 'squoosh': - devService = '@astrojs/vercel/squoosh-dev-image-service'; - break; default: if (typeof devImageService === 'string') { devService = devImageService; diff --git a/packages/integrations/vercel/src/image/squoosh-dev-service.ts b/packages/integrations/vercel/src/image/squoosh-dev-service.ts deleted file mode 100644 index d3b05bb11..000000000 --- a/packages/integrations/vercel/src/image/squoosh-dev-service.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { LocalImageService } from 'astro'; -import squooshService from 'astro/assets/services/squoosh'; -import { baseDevService } from './shared-dev-service.js'; - -const service: LocalImageService = { - ...baseDevService, - getHTMLAttributes(options, serviceOptions) { - const { inputtedWidth, ...props } = options; - - // If `validateOptions` returned a different width than the one of the image, use it for attributes - if (inputtedWidth) { - props.width = inputtedWidth; - } - - return squooshService.getHTMLAttributes - ? squooshService.getHTMLAttributes(props, serviceOptions) - : {}; - }, - transform(inputBuffer, transform, serviceOptions) { - // NOTE: Hardcoding webp here isn't accurate to how the Vercel Image Optimization API works, normally what we should - // do is setup a custom endpoint that sniff the user's accept-content header and serve the proper format based on the - // user's Vercel config. However, that's: a lot of work for: not much. The dev service is inaccurate to the prod service - // in many more ways, this is one of the less offending cases and is, imo, okay, erika - 2023-04-27 - transform.format = transform.src.endsWith('svg') ? 'svg' : 'webp'; - - // The base squoosh service works the same way as the Vercel Image Optimization API, so it's a safe fallback in local - return squooshService.transform(inputBuffer, transform, serviceOptions); - }, -}; - -export default service; diff --git a/packages/integrations/vercel/src/serverless/adapter.ts b/packages/integrations/vercel/src/serverless/adapter.ts index cd14e25b3..bbc624e97 100644 --- a/packages/integrations/vercel/src/serverless/adapter.ts +++ b/packages/integrations/vercel/src/serverless/adapter.ts @@ -92,7 +92,6 @@ function getAdapter({ assets: { supportKind: 'stable', isSharpCompatible: true, - isSquooshCompatible: true, }, i18nDomains: 'experimental', envGetSecret: 'experimental', diff --git a/packages/integrations/vercel/src/static/adapter.ts b/packages/integrations/vercel/src/static/adapter.ts index 4e1b19d8f..4969d55d1 100644 --- a/packages/integrations/vercel/src/static/adapter.ts +++ b/packages/integrations/vercel/src/static/adapter.ts @@ -26,7 +26,6 @@ function getAdapter(): AstroAdapter { supportedAstroFeatures: { assets: { supportKind: 'stable', - isSquooshCompatible: true, isSharpCompatible: true, }, staticOutput: 'stable', |