From 1a8d4f7f603ac08b24ae6cd390f3a0fe39f4c87d Mon Sep 17 00:00:00 2001 From: Tony Sullivan Date: Mon, 12 Sep 2022 16:26:01 -0500 Subject: [PATCH] defaulting to Sharp for the initial @next release --- packages/integrations/image/src/index.ts | 6 ++++-- packages/integrations/image/src/lib/get-image.ts | 2 +- packages/integrations/image/src/vite-plugin-astro-image.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts index c22bded15..43c7d8997 100644 --- a/packages/integrations/image/src/index.ts +++ b/packages/integrations/image/src/index.ts @@ -32,7 +32,7 @@ export interface IntegrationOptions { export default function integration(options: IntegrationOptions = {}): AstroIntegration { const resolvedOptions = { - serviceEntryPoint: '@astrojs/image/squoosh', + serviceEntryPoint: '@astrojs/image/sharp', logLevel: 'info' as LoggerLevel, ...options, }; @@ -106,7 +106,9 @@ export default function integration(options: IntegrationOptions = {}): AstroInte : {}; }, 'astro:build:done': async ({ dir }) => { - await copyLibFiles(_config.output === 'static' ? dir : _buildConfig.server); + if (resolvedOptions.serviceEntryPoint === '@astrojs/image/squoosh') { + await copyLibFiles(_config.output === 'static' ? dir : _buildConfig.server); + } if (_config.output === 'static') { // for SSG builds, build all requested image transforms to dist diff --git a/packages/integrations/image/src/lib/get-image.ts b/packages/integrations/image/src/lib/get-image.ts index c6f5ab941..856f9f8c6 100644 --- a/packages/integrations/image/src/lib/get-image.ts +++ b/packages/integrations/image/src/lib/get-image.ts @@ -6,7 +6,7 @@ import type { TransformOptions, } from '../loaders/index.js'; import { isSSRService, parseAspectRatio } from '../loaders/index.js'; -import sharp from '../loaders/squoosh.js'; +import sharp from '../loaders/sharp.js'; import { isRemoteImage } from '../utils/paths.js'; import type { ImageMetadata } from '../vite-plugin-astro-image.js'; diff --git a/packages/integrations/image/src/vite-plugin-astro-image.ts b/packages/integrations/image/src/vite-plugin-astro-image.ts index 5a43909e5..f19c557c3 100644 --- a/packages/integrations/image/src/vite-plugin-astro-image.ts +++ b/packages/integrations/image/src/vite-plugin-astro-image.ts @@ -8,7 +8,7 @@ import slash from 'slash'; import type { Plugin, ResolvedConfig } from 'vite'; import type { IntegrationOptions } from './index.js'; import type { InputFormat } from './loaders/index.js'; -import sharp from './loaders/squoosh.js'; +import sharp from './loaders/sharp.js'; import { metadata } from './utils/metadata.js'; export interface ImageMetadata {