From 3c07d6af4d1eb0beb959b35e19768ba2ad7a0037 Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Sat, 17 Dec 2022 16:32:01 +0000 Subject: [PATCH] fix: use fileURLToPath to normalize publicDir pathname accross operating systems fixes #79 --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e0e4282..31539e8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { deeplyStringifyObject, getUserConfig, } from "./utils"; +import { fileURLToPath } from "url"; export default (options?: AstroI18nextOptions): AstroIntegration => { const customConfigPath = options?.configPath; @@ -74,7 +75,7 @@ export default (options?: AstroI18nextOptions): AstroIntegration => { initImmediate: false, backend: { loadPath: - config.publicDir.pathname + "locales/{{lng}}/{{ns}}.json", + fileURLToPath(config.publicDir) + "locales/{{lng}}/{{ns}}.json", }, ...astroI18nextConfig.i18nextServer, };