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:
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user