From 4633d58289d778e9d6deef1f8040c0ff006ff819 Mon Sep 17 00:00:00 2001 From: MINKYU LEE Date: Thu, 18 Jul 2024 17:44:05 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20base=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=8B=9C=20url=20=EC=9C=A0=ED=8B=B8=20=EC=A0=95=EC=83=81=20?= =?UTF-8?q?=EB=8F=99=EC=9E=91=20=EC=95=88=20=ED=95=98=EB=8A=94=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/find-waffle/src/utils/url.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } From e65f6abf74aaeea2daddadc12b1094c0e6de63b5 Mon Sep 17 00:00:00 2001 From: Minkyu Lee Date: Thu, 18 Jul 2024 19:49:00 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20import.meta=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/find-waffle/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"] }