not collect module

Signed-off-by: chengongping <chengongping@huawei.com>
Change-Id: I33e8444864815036d667a3157cc3b8dbe135701d
This commit is contained in:
chengongping
2022-05-20 12:34:44 +08:00
parent b59bcdaa0d
commit f605b09fd0
+13 -11
View File
@@ -94,17 +94,19 @@ export class ResultStates {
);
compilation.hooks.buildModule.tap('findModule', (module) => {
if (module.context.indexOf(projectConfig.projectPath) >= 0) {
return;
}
const modulePath: string = path.join(module.context);
const srcIndex: number = modulePath.lastIndexOf(MODULE_ETS_PATH);
if (srcIndex < 0) {
return;
}
const moduleSharePath: string = path.resolve(modulePath.substring(0, srcIndex), MODULE_SHARE_PATH);
if (fs.existsSync(moduleSharePath)) {
this.moduleSharePaths.add(moduleSharePath);
if (module.context) {
if (module.context.indexOf(projectConfig.projectPath) >= 0) {
return;
}
const modulePath: string = path.join(module.context);
const srcIndex: number = modulePath.lastIndexOf(MODULE_ETS_PATH);
if (srcIndex < 0) {
return;
}
const moduleSharePath: string = path.resolve(modulePath.substring(0, srcIndex), MODULE_SHARE_PATH);
if (fs.existsSync(moduleSharePath)) {
this.moduleSharePaths.add(moduleSharePath);
}
}
});
});