diff --git a/projects/find-waffle/src/utils/url.ts b/projects/find-waffle/src/utils/url.ts index 2db9be15..56476dac 100644 --- a/projects/find-waffle/src/utils/url.ts +++ b/projects/find-waffle/src/utils/url.ts @@ -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; } diff --git a/projects/find-waffle/tsconfig.json b/projects/find-waffle/tsconfig.json index 9302bbb9..0bb6da64 100644 --- a/projects/find-waffle/tsconfig.json +++ b/projects/find-waffle/tsconfig.json @@ -17,7 +17,8 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "types": ["vite/client"] }, "include": ["src"] }