diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index 465492b1e76464e68a3ee4d73c2522b1567a46cf..2d7fc10ea861edf6cc5936e7a1fc1544a8aa52c8 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -511,18 +511,18 @@ export abstract class BaseMode { const mainModuleInfo = this.dependentModuleList.find((module: DependentModuleConfig) => module.packageName === this.packageName); return { isMainModule: this.hasMainModule, - packageName: this.packageName, - moduleRootPath: this.moduleRootPath, - moduleType: this.moduleType, + packageName: mainModuleInfo?.packageName ?? this.packageName, + moduleRootPath: mainModuleInfo?.modulePath ?? this.moduleRootPath, + moduleType: mainModuleInfo?.moduleType ?? this.moduleType, sourceRoots: this.sourceRoots, entryFile: '', arktsConfigFile: path.resolve(this.cacheDir, this.packageName, ARKTSCONFIG_JSON_FILE), dynamicDepModuleInfos: new Map(), staticDepModuleInfos: new Map(), compileFileInfos: [], - declgenV1OutPath: this.declgenV1OutPath, - declgenV2OutPath: this.declgenV2OutPath, - declgenBridgeCodePath: this.declgenBridgeCodePath, + declgenV1OutPath: mainModuleInfo?.declgenV1OutPath ?? this.declgenV1OutPath, + declgenV2OutPath: mainModuleInfo?.declgenV2OutPath ?? this.declgenV2OutPath, + declgenBridgeCodePath: mainModuleInfo?.declgenBridgeCodePath ?? this.declgenBridgeCodePath, byteCodeHar: this.byteCodeHar, language: mainModuleInfo?.language ?? LANGUAGE_VERSION.ARKTS_1_2, declFilesPath: mainModuleInfo?.declFilesPath,