diff --git a/compiler/src/fast_build/ark_compiler/module/module_preload_file_utils.ts b/compiler/src/fast_build/ark_compiler/module/module_preload_file_utils.ts index bfe9b50ad22d2c2d63fbf01a5f06bf18896de4ea..0e55b9b3ef04c0534ed0cbc59a877fc8745e2167 100644 --- a/compiler/src/fast_build/ark_compiler/module/module_preload_file_utils.ts +++ b/compiler/src/fast_build/ark_compiler/module/module_preload_file_utils.ts @@ -49,6 +49,10 @@ export class PreloadFileModules { public static initialize(rollupObject: Object): void { this.projectConfig = Object.assign(rollupObject.share.arkProjectConfig, rollupObject.share.projectConfig); this.logger = CommonLogger.getInstance(rollupObject); + if (!this.projectConfig.isPreloadSoEnabled) { + this.needPreloadSo = false; + return; + } if (this.projectConfig.widgetCompile) { this.needPreloadSo = false; return; @@ -59,7 +63,7 @@ export class PreloadFileModules { } this.needPreloadSo = true; this.preloadFilePath = this.projectConfig.preloadSoFilePath; - this.preloadFilePathBack = this.preloadFilePath.replace('.json', '.backup.json'); + this.preloadFilePathBack = path.resolve(this.projectConfig.cachePath, `./preload.json`); } public static updatePreloadFileDataByItems(moduleRequest: string, ohmurl: string, moduleId: string): void {