Skip to content

Commit

Permalink
refactor(compiler-cli): import manager not picking up some options (a…
Browse files Browse the repository at this point in the history
…ngular#57096)

Fixes that the `ImportManager` wasn't picking up some of its configuration options.

PR Close angular#57096
  • Loading branch information
crisbeto authored and atscott committed Jul 23, 2024
1 parent 6cbcef2 commit b464c3d
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,15 @@ export class ImportManager
namespaceImportReuseCache: new Map(),
};

constructor(private _config: Partial<ImportManagerConfig> = {}) {
constructor(config: Partial<ImportManagerConfig> = {}) {
this.config = {
shouldUseSingleQuotes: () => false,
rewriter: null,
disableOriginalSourceFileReuse: false,
forceGenerateNamespacesForNewImports: false,
namespaceImportPrefix: 'i',
shouldUseSingleQuotes: config.shouldUseSingleQuotes ?? (() => false),
rewriter: config.rewriter ?? null,
disableOriginalSourceFileReuse: config.disableOriginalSourceFileReuse ?? false,
forceGenerateNamespacesForNewImports: config.forceGenerateNamespacesForNewImports ?? false,
namespaceImportPrefix: config.namespaceImportPrefix ?? 'i',
generateUniqueIdentifier:
this._config.generateUniqueIdentifier ?? createGenerateUniqueIdentifierHelper(),
...this._config,
config.generateUniqueIdentifier ?? createGenerateUniqueIdentifierHelper(),
};
this.reuseSourceFileImportsTracker = {
generateUniqueIdentifier: this.config.generateUniqueIdentifier,
Expand Down

0 comments on commit b464c3d

Please sign in to comment.