From 5469b4f18d1c1ee4c7167a176ba86a5d83da4457 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 18 Jul 2024 15:04:35 +0200 Subject: [PATCH] SW-229 Added jiti support windows --- next.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index be21bf182..f37c7e004 100644 --- a/next.config.js +++ b/next.config.js @@ -4,7 +4,12 @@ import { login, logout } from "./constants/routes/handleAuth.js" import { hotelReservation } from "./constants/routes/hotelReservation.js" import { myPages } from "./constants/routes/myPages.js" -const jiti = createJiti(new URL(import.meta.url).pathname) +let path = new URL(import.meta.url).pathname +// Update the path if running in windows system +if (process.platform === "win32") { + path = path.replace(/^\/(\w):/, "$1:") +} +const jiti = createJiti(path) jiti("./env/server") jiti("./env/client")