Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion projects/find-waffle/src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
* @returns 절대 경로
*/
export function url(path: string): string {
return new URL(path, import.meta.url).href;
const BASE_URL = `${window.location.origin}${import.meta.env.BASE_URL}/`;
if (path.startsWith('/')) path = "." + path
else if (!path.startsWith('./')) path = "./" + path
return new URL(path, BASE_URL).href;
}
3 changes: 2 additions & 1 deletion projects/find-waffle/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"types": ["vite/client"]
},
"include": ["src"]
}