From 27672096f504c567dadd2540fa0e21be59924483 Mon Sep 17 00:00:00 2001 From: Maarten Van Hoof Date: Tue, 3 Aug 2021 14:17:24 +0200 Subject: [PATCH] fix: Exclude remote srcset URLs (#986) * fix: Exclude remote srcset URLs Fixed #985 * chore: add changeset for 'Exclude remote srcset URLs' --- .changeset/fair-cameras-draw.md | 5 +++++ packages/astro/src/build.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/fair-cameras-draw.md diff --git a/.changeset/fair-cameras-draw.md b/.changeset/fair-cameras-draw.md new file mode 100644 index 000000000..317283825 --- /dev/null +++ b/.changeset/fair-cameras-draw.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Exclude remote srcset URLs diff --git a/packages/astro/src/build.ts b/packages/astro/src/build.ts index 28e164f78..b37b612b5 100644 --- a/packages/astro/src/build.ts +++ b/packages/astro/src/build.ts @@ -303,7 +303,9 @@ export function findDeps(html: string, { astroConfig, srcPath }: { astroConfig: const sources = srcset.split(','); const srces = sources.map((s) => s.trim().split(' ')[0]); for (const src of srces) { - pageDeps.images.add(getDistPath(src, { astroConfig, srcPath })); + if (!isRemote(src)) { + pageDeps.images.add(getDistPath(src, { astroConfig, srcPath })); + } } });