Skip to content

Commit

Permalink
fix: remove unpkg url
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenjohanson committed Sep 9, 2024
1 parent dd6c593 commit 0acb3f8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/excalidraw/fonts/ExcalidrawFont.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ export interface Font {
fontFace: FontFace;
getContent(): Promise<string>;
}
export const UNPKG_PROD_URL = `https://unpkg.com/${
import.meta.env.VITE_PKG_NAME
export const UNPKG_PROD_URL = `https://unpkg.com/${import.meta.env.VITE_PKG_NAME
? `${import.meta.env.VITE_PKG_NAME}@${import.meta.env.PKG_VERSION}` // should be provided by vite during package build
: "@excalidraw/excalidraw" // fallback to latest package version (i.e. for app)
}/dist/prod/`;
}/dist/prod/`;

export class ExcalidrawFont implements Font {
public readonly urls: URL[];
Expand Down Expand Up @@ -78,8 +77,7 @@ export class ExcalidrawFont implements Font {
}

console.error(
`Failed to fetch font "${
this.fontFace.family
`Failed to fetch font "${this.fontFace.family
}" from urls "${this.urls.toString()}`,
JSON.stringify(errorMessages, undefined, 2),
);
Expand Down Expand Up @@ -118,7 +116,7 @@ export class ExcalidrawFont implements Font {
}

// fallback url for bundled fonts
urls.push(new URL(assetUrl, UNPKG_PROD_URL));
//urls.push(new URL(assetUrl, UNPKG_PROD_URL));

return urls;
}
Expand Down

0 comments on commit 0acb3f8

Please sign in to comment.