Skip to content

Commit c57658b

Browse files
authored
Merge pull request #579 from processing/jsdelivr
Use jsdelivr as CDN
2 parents 42e9c6c + a2bf884 commit c57658b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/globals/globals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const sketchesPerPage = 12 as const;
1414
export const eventsPerPage = 12 as const;
1515

1616
export const cdnLibraryUrl =
17-
`https://cdnjs.cloudflare.com/ajax/libs/p5.js/${p5Version}/p5.min.js` as const;
17+
`https://cdn.jsdelivr.net/npm/p5@${p5Version}/lib/p5.min.js` as const;
1818
export const fullDownloadUrl =
1919
`https://github.com/processing/p5.js/releases/download/v${p5Version}/p5.zip` as const;
2020
export const libraryDownloadUrl =

test/mocks/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const handlers = [
1616
readFileSync("./assets/p5.min.js", { encoding: "utf-8" }),
1717
);
1818
}),
19+
http.get("https://cdn.jsdelivr.net/npm/p5*", () => {
20+
return HttpResponse.text(
21+
readFileSync("./assets/p5.min.js", { encoding: "utf-8" }),
22+
);
23+
}),
1924
];
2025

2126
/**

0 commit comments

Comments
 (0)