Skip to content

Commit

Permalink
fix(project): fix getPublicUrl for dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jwpradm committed Dec 13, 2021
1 parent 88ffa73 commit ec9bc60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/domHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export function getPublicUrl(url: string) {
return url;
}

const baseUrl = import.meta.env.SNOWPACK_PUBLIC_BASE_URL;
const baseUrl = import.meta.env.SNOWPACK_PUBLIC_BASE_URL || '';
const trimSlashes = (s: string) => s.replace(/^\/+|\/+$/g, '');

return '/' + [baseUrl, url].map(trimSlashes).join('/');
return (baseUrl ? '/' : '') + [baseUrl, url].map(trimSlashes).join('/');
}

export default function scrollbarSize(recalc?: boolean) {
Expand Down

0 comments on commit ec9bc60

Please sign in to comment.