fix: module import paths to contain unix slash (#12592)

Currently when types are generated on Windows, they result in using Windows slash for relative imports. This PR, fixes that to always use Unix imports
This commit is contained in:
Harminder Virk
2025-05-23 13:39:34 +05:30
committed by GitHub
parent da5e278a78
commit f6f34cc0e4
2 changed files with 7 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ import { join } from "path"
import { Modules } from "./definition"
import type { LoadedModule } from "@medusajs/types"
import { FileSystem } from "../common/file-system"
import { toUnixSlash } from "../common/to-unix-slash"
import { toCamelCase } from "../common/to-camel-case"
import { upperCaseFirst } from "../common/upper-case-first"
@@ -56,7 +57,7 @@ const SERVICES_INTERFACES = {
*/
function normalizeModuleResolvePath(modulePath: string) {
return modulePath.startsWith("./") || modulePath.startsWith("../")
? join("../", "../", modulePath)
? toUnixSlash(join("../", "../", modulePath))
: modulePath
}