mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
fix: don't add the symbol at runtime
This commit is contained in:
parent
095083ed6c
commit
6469054883
2 changed files with 3 additions and 4 deletions
|
@ -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<ImageMetadata, 'fsPath'> = {
|
||||
const emittedImage: Omit<ImageMetadata, 'fsPath' | typeof image_metadata> = {
|
||||
src: '',
|
||||
...fileMetadata,
|
||||
};
|
||||
|
|
|
@ -5,7 +5,7 @@ import { lookup as probe } from '../utils/vendor/image-size/lookup.js';
|
|||
export async function imageMetadata(
|
||||
data: Uint8Array,
|
||||
src?: string
|
||||
): Promise<Omit<ImageMetadata, 'src' | 'fsPath'>> {
|
||||
): Promise<Omit<ImageMetadata, 'src' | 'fsPath' | typeof image_metadata>> {
|
||||
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({
|
||||
|
|
Loading…
Reference in a new issue