[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

docs: concurrent image downloading and `as` an attribute for prefetch links (#4122)

authored by

Sanjaiyan Parthipan and committed by
GitHub
(Sep 15, 2023, 10:54 AM +0200) b245ce3d 1fe92676

+11 -9
+5 -3
docs/.vitepress/scripts/fetch-avatars.ts
··· 31 31 32 32 async function fetchSponsors() { 33 33 await fs.ensureDir(dirSponsors) 34 - await download('https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg', join(dirSponsors, 'antfu.svg')) 35 - await download('https://cdn.jsdelivr.net/gh/patak-dev/static/sponsors.svg', join(dirSponsors, 'patak-dev.svg')) 36 - await download('https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg', join(dirSponsors, 'sheremet-va.svg')) 34 + await Promise.all([ 35 + download('https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg', join(dirSponsors, 'antfu.svg')), 36 + download('https://cdn.jsdelivr.net/gh/patak-dev/static/sponsors.svg', join(dirSponsors, 'patak-dev.svg')), 37 + download('https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg', join(dirSponsors, 'sheremet-va.svg')), 38 + ]) 37 39 } 38 40 39 41 fetchAvatars()
+6 -6
docs/.vitepress/scripts/transformHead.ts
··· 12 12 head.push(['link', { rel: 'preconnect', href: link }]) 13 13 }) 14 14 15 - head.push(['link', { rel: 'prefetch', href: '/logo.svg' }]) 15 + head.push(['link', { rel: 'prefetch', href: '/logo.svg', as: 'image' }]) 16 16 if (home) { 17 - head.push(['link', { rel: 'prefetch', href: '/logo-shadow.svg' }]) 18 - head.push(['link', { rel: 'prefetch', href: '/sponsors/antfu.svg' }]) 19 - head.push(['link', { rel: 'prefetch', href: '/sponsors/sheremet-va.svg' }]) 20 - head.push(['link', { rel: 'prefetch', href: '/sponsors/patak-dev.svg' }]) 21 - head.push(['link', { rel: 'prefetch', href: '/netlify.svg' }]) 17 + head.push(['link', { rel: 'prefetch', href: '/logo-shadow.svg', as: 'image' }]) 18 + head.push(['link', { rel: 'prefetch', href: '/sponsors/antfu.svg', as: 'image' }]) 19 + head.push(['link', { rel: 'prefetch', href: '/sponsors/sheremet-va.svg', as: 'image' }]) 20 + head.push(['link', { rel: 'prefetch', href: '/sponsors/patak-dev.svg', as: 'image' }]) 21 + head.push(['link', { rel: 'prefetch', href: '/netlify.svg', as: 'image' }]) 22 22 } 23 23 24 24 return head