diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index c5282cded0b2062f288b73a81241293d08ab23d0..5862c017b1397babb7ad7961ab48662850c791c3 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -558,7 +558,8 @@ export abstract class BaseMode { } this.entryFiles.forEach((file: string) => { for (const [packageName, moduleInfo] of this.moduleInfos) { - if (!file.startsWith(moduleInfo.moduleRootPath)) { + const relativePath = path.relative(moduleInfo.moduleRootPath, file); + if (relativePath.startsWith('..') || path.isAbsolute(relativePath)) { continue; } let filePathFromModuleRoot: string = path.relative(moduleInfo.moduleRootPath, file);