diff --git a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts index 89cd4cd542df4732b5fcc28e933aeb5ae5dc18b4..b53f53253a78e05941f30a8d639c12880c5299dc 100644 --- a/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts +++ b/compiler/src/fast_build/ets_ui/rollup-plugin-ets-checker.ts @@ -47,7 +47,12 @@ import { MemoryMonitor } from '../meomry_monitor/rollup-plugin-memory-monitor'; import { MemoryDefine } from '../meomry_monitor/memory_define'; import { LINTER_SUBSYSTEM_CODE } from '../../hvigor_error_code/hvigor_error_info'; import { ErrorCodeModule } from '../../hvigor_error_code/const/error_code_module'; -import { collectArkTSEvolutionModuleInfo } from '../../process_arkts_evolution'; +import { + arkTSModuleMap, + arkTSEvolutionModuleMap, + arkTSHybridModuleMap, + collectArkTSEvolutionModuleInfo +} from '../../process_arkts_evolution'; import { initFileManagerInRollup, FileManager @@ -163,7 +168,30 @@ function getErrorCodeLogger(code: string, share: Object): Object | undefined { function rootFileNamesCollect(rootFileNames: string[]): void { const entryFiles: string[] = projectConfig.widgetCompile ? Object.values(projectConfig.cardEntryObj) : Object.values(projectConfig.entryObj); + + const bridgeCodePaths = collectDeclgenBridgePaths(); entryFiles.forEach((fileName: string) => { + const isUnderBridgeDir = Array.from(bridgeCodePaths).some(bridgeCodePath => { + return fileName.startsWith(bridgeCodePath + path.sep) || fileName === bridgeCodePath; + }); + + if (isUnderBridgeDir) { + return; + } + rootFileNames.push(path.resolve(fileName)); }); +} + +function collectDeclgenBridgePaths(): Set { + const paths = new Set(); + [arkTSModuleMap, arkTSEvolutionModuleMap, arkTSHybridModuleMap].forEach(map => { + for (const value of map.values()) { + if (value.declgenBridgeCodePath) { + paths.add(value.declgenBridgeCodePath); + } + } + }); + + return paths; } \ No newline at end of file