diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index 84435af40ceda0391c4d7da20e8f5977ff20fd33..54c4b9702fa8aadb58b4b6ba1f33c67422dcef9f 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -509,18 +509,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,