Skip to content

Commit

Permalink
Merge pull request #579 from processing/jsdelivr
Browse files Browse the repository at this point in the history
Use jsdelivr as CDN
  • Loading branch information
Qianqianye authored Sep 28, 2024
2 parents 42e9c6c + a2bf884 commit c57658b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/globals/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const sketchesPerPage = 12 as const;
export const eventsPerPage = 12 as const;

export const cdnLibraryUrl =
`https://cdnjs.cloudflare.com/ajax/libs/p5.js/${p5Version}/p5.min.js` as const;
`https://cdn.jsdelivr.net/npm/p5@${p5Version}/lib/p5.min.js` as const;
export const fullDownloadUrl =
`https://github.com/processing/p5.js/releases/download/v${p5Version}/p5.zip` as const;
export const libraryDownloadUrl =
Expand Down
5 changes: 5 additions & 0 deletions test/mocks/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const handlers = [
readFileSync("./assets/p5.min.js", { encoding: "utf-8" }),
);
}),
http.get("https://cdn.jsdelivr.net/npm/p5*", () => {
return HttpResponse.text(
readFileSync("./assets/p5.min.js", { encoding: "utf-8" }),
);
}),
];

/**
Expand Down

0 comments on commit c57658b

Please sign in to comment.