1
0
mirror of https://github.com/morris/vanilla-todo.git synced 2025-08-21 13:21:29 +02:00

switch icon cdn, add preconnect, move module preload up

This commit is contained in:
Morris Brodersen
2023-11-26 14:31:16 +01:00
parent 6a640515b2
commit c91b27980e
2 changed files with 18 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
export const BASE_URL = 'https://unpkg.com/@primer/octicons@19.8.0/build/svg/';
export const BASE_URL =
'https://cdn.jsdelivr.net/npm/@primer/octicons@19.8.0/build/svg';
const cache = {};
@@ -12,7 +13,7 @@ export function AppIcon(el) {
let promise = cache[id];
if (!promise) {
promise = cache[id] = fetch(`${BASE_URL}${id}.svg`).then((r) => r.text());
promise = cache[id] = fetch(`${BASE_URL}/${id}.svg`).then((r) => r.text());
}
promise.then((svg) => {