diff --git a/ets2panda/driver/build_system/src/build/base_mode.ts b/ets2panda/driver/build_system/src/build/base_mode.ts index dccb49481f89cbbff28832bcd2ae3f123f0b0dc0..7006173f9083dfaf9dd29e23c94a052263f0d7d6 100644 --- a/ets2panda/driver/build_system/src/build/base_mode.ts +++ b/ets2panda/driver/build_system/src/build/base_mode.ts @@ -472,18 +472,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,