Skip to content

Commit

Permalink
fix: case
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Mar 1, 2021
1 parent 4df51ed commit df2efb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/core/src/context/applicationContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ export class BaseApplicationContext
) {
if (!this.disableConflictCheck && this.registry.hasDefinition(identifier)) {
const def = this.registry.getDefinition(identifier);
if (!PathFileUtil.isPathEqual(definition.srcPath, def.srcPath)) {
throw new Error(
`${identifier} path = ${definition.srcPath} already exist (${def.srcPath})!`
);
if (definition.srcPath && def.srcPath) {
if (!PathFileUtil.isPathEqual(definition.srcPath, def.srcPath)) {
throw new Error(
`${identifier} path = ${definition.srcPath} already exist (${def.srcPath})!`
);
}
}
}
this.registry.registerDefinition(identifier, definition);
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/context/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ export class ContainerConfiguration implements IContainerConfiguration {
}
}
} else {
if (this.namespace === MAIN_MODULE_KEY) {
this.container.disableConflictCheck = true;
}
if (
this.container.containsConfiguration(this.packageName) &&
this.namespace !== ''
Expand Down

0 comments on commit df2efb6

Please sign in to comment.