diff --git a/compiler/src/ark_utils.ts b/compiler/src/ark_utils.ts index e2f03dac37deb63e4125e40a91ed0b961fa4a151..4e80f44decb4b6707baa135dcf72fb575a67743c 100644 --- a/compiler/src/ark_utils.ts +++ b/compiler/src/ark_utils.ts @@ -548,7 +548,7 @@ export function getOhmUrlByExternalPackage(moduleRequest: string, projectConfig: const ohmName: string = externalPkgMap[externalPkgName].substring(0, idx); if (moduleInfoByModuleRequest) { // when useNormalizedOHMUrl=false, and packageName combines with directory to import file, OhmUrl is supposed to end with "index" - const relativePathByModuleRequest: string = moduleInfoByModuleRequest.normalizedPath.split(SRC_MAIN)[1]; + const relativePathByModuleRequest: string = toUnixPath(moduleInfoByModuleRequest.normalizedPath).split(SRC_MAIN)[1]; // "@bundle:bundleName/lib" + "/ets/pages/page1" return ohmName + relativePathByModuleRequest; } diff --git a/compiler/src/interop/src/ark_utils.ts b/compiler/src/interop/src/ark_utils.ts index 77dbf031560f1ce84998d468f1edb5757b13734c..8c88df3389cf919e5408f88b933e8f2b72289a17 100644 --- a/compiler/src/interop/src/ark_utils.ts +++ b/compiler/src/interop/src/ark_utils.ts @@ -572,7 +572,7 @@ export function getOhmUrlByExternalPackage(moduleRequest: string, projectConfig: const ohmName: string = externalPkgMap[externalPkgName].substring(0, idx); if (moduleInfoByModuleRequest) { // when useNormalizedOHMUrl=false, and packageName combines with directory to import file, OhmUrl is supposed to end with "index" - const relativePathByModuleRequest: string = moduleInfoByModuleRequest.normalizedPath.split(SRC_MAIN)[1]; + const relativePathByModuleRequest: string = toUnixPath(moduleInfoByModuleRequest.normalizedPath).split(SRC_MAIN)[1]; // "@bundle:bundleName/lib" + "/ets/pages/page1" return ohmName + relativePathByModuleRequest; }