fix: Exclude remote srcset URLs (#986)

* fix: Exclude remote srcset URLs

Fixed #985

* chore: add changeset for 'Exclude remote srcset URLs'
This commit is contained in:
Maarten Van Hoof 2021-08-03 14:17:24 +02:00 committed by GitHub
parent 0334956030
commit 27672096f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Exclude remote srcset URLs

View file

@ -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 }));
}
}
});