From 64690548831d68f813906ab3441a31dc1952ecb7 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Mon, 27 May 2024 14:47:03 -0400 Subject: [PATCH] fix: don't add the symbol at runtime --- packages/astro/src/assets/utils/emitAsset.ts | 4 ++-- packages/astro/src/assets/utils/metadata.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/astro/src/assets/utils/emitAsset.ts b/packages/astro/src/assets/utils/emitAsset.ts index 1b6bb207bb..3f45e9c0ed 100644 --- a/packages/astro/src/assets/utils/emitAsset.ts +++ b/packages/astro/src/assets/utils/emitAsset.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import type * as vite from 'vite'; import { prependForwardSlash, slash } from '../../core/path.js'; -import type { ImageMetadata } from '../types.js'; +import type { ImageMetadata, image_metadata } from '../types.js'; import { imageMetadata } from './metadata.js'; type FileEmitter = vite.Rollup.EmitFile; @@ -30,7 +30,7 @@ export async function emitESMImage( const fileMetadata = await imageMetadata(fileData, id); - const emittedImage: Omit = { + const emittedImage: Omit = { src: '', ...fileMetadata, }; diff --git a/packages/astro/src/assets/utils/metadata.ts b/packages/astro/src/assets/utils/metadata.ts index b1cccdc49f..93942d3222 100644 --- a/packages/astro/src/assets/utils/metadata.ts +++ b/packages/astro/src/assets/utils/metadata.ts @@ -5,7 +5,7 @@ import { lookup as probe } from '../utils/vendor/image-size/lookup.js'; export async function imageMetadata( data: Uint8Array, src?: string -): Promise> { +): Promise> { try { const result = probe(data); if (!result.height || !result.width || !result.type) { @@ -23,7 +23,6 @@ export async function imageMetadata( height: isPortrait ? width : height, format: type as ImageInputFormat, orientation, - [image_metadata]: true, }; } catch (e) { throw new AstroError({