Skip to content

Commit

Permalink
fix: storybook public url
Browse files Browse the repository at this point in the history
  • Loading branch information
mykeels committed Nov 8, 2022
1 parent 127ca75 commit 5cb633c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions App/src/App.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default {

const queryClient = new QueryClient();
const asset = (url) => {
const publicUrl = `${process.env.STORYBOOK_PUBLIC_URL}`;
const publicUrl = `${process.env.STORYBOOK_PUBLIC_URL || "/"}`;
const root = publicUrl === "." ? "" : publicUrl;
return String(`${root || ""}${url}`).replace("//", "/").replace("//", "/");
return String(`${root}${url}`).replace("//", "/");
};

console.log(asset(`/sounds/something-just-like-this.mp3`));
Expand Down

0 comments on commit 5cb633c

Please sign in to comment.