From 2e2d6b7442063c8eb32533d45eaf021c3fa0f615 Mon Sep 17 00:00:00 2001 From: Alexander S <1203110+xsynaptic@users.noreply.github.com> Date: Tue, 14 May 2024 01:40:52 -0700 Subject: [PATCH] fix(astro): refine assets prefix typing (#11020) --- .changeset/seven-crabs-burn.md | 5 +++++ packages/astro/client.d.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/seven-crabs-burn.md diff --git a/.changeset/seven-crabs-burn.md b/.changeset/seven-crabs-burn.md new file mode 100644 index 000000000000..e1badd5dd0a0 --- /dev/null +++ b/.changeset/seven-crabs-burn.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Add type declarations for `import.meta.env.ASSETS_PREFIX` when defined as an object for handling different file types. diff --git a/packages/astro/client.d.ts b/packages/astro/client.d.ts index f81d652e3808..3083247cfc0f 100644 --- a/packages/astro/client.d.ts +++ b/packages/astro/client.d.ts @@ -12,7 +12,7 @@ interface ImportMetaEnv { /** * The prefix for Astro-generated asset links if the build.assetsPrefix config option is set. This can be used to create asset links not handled by Astro. */ - readonly ASSETS_PREFIX: string; + readonly ASSETS_PREFIX: string | Record; /** * This is set to the site option specified in your project’s Astro config file. */