mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
# Conflicts: # astro.config.ts # package-lock.json # package.json # src/types/plausible.d.ts # src/utils/debounce.ts
20 lines
635 B
TypeScript
20 lines
635 B
TypeScript
import * as astroImage from "@astrojs/image";
|
|
import {
|
|
GetPictureParams,
|
|
GetPictureResult,
|
|
} from "@astrojs/image/dist/lib/get-picture";
|
|
import squoosh_service from "../../../node_modules/@astrojs/image/dist/loaders/squoosh.js";
|
|
|
|
export function getPicture(
|
|
params: GetPictureParams,
|
|
): Promise<GetPictureResult> {
|
|
// HACK: This is a hack that heavily relies on `getImage`'s internals :(
|
|
globalThis.astroImage = {
|
|
...(globalThis.astroImage || {}),
|
|
loader: globalThis.astroImage?.loader ?? squoosh_service,
|
|
defaultLoader: globalThis.astroImage?.defaultLoader ?? squoosh_service,
|
|
};
|
|
|
|
return astroImage.getPicture(params);
|
|
}
|