fix(ngcc): support ignoring deep-imports via package config (#36423)

Recently we added support for ignoring specified deep-import
warnings by providing sets of regular expressions within the
`ngcc.config.js` file. But this was only working for the project
level configuration.

This commit fixes ngcc so that it will also read these regular
expressions from package level configuration too.

Fixes #35750

PR Close #36423
This commit is contained in:
Pete Bacon Darwin
2020-04-03 22:00:51 +01:00
committed by Kara Erickson
parent b0d680daa0
commit 31eaf78035
2 changed files with 49 additions and 3 deletions

View File

@ -241,9 +241,11 @@ export class NgccConfiguration {
const configFilePath = join(packagePath, NGCC_CONFIG_FILENAME);
if (this.fs.exists(configFilePath)) {
try {
const packageConfig = this.evalSrcFile(configFilePath);
return {
...packageConfig,
versionRange: version || '*',
entryPoints: this.processEntryPoints(packagePath, this.evalSrcFile(configFilePath)),
entryPoints: this.processEntryPoints(packagePath, packageConfig),
};
} catch (e) {
throw new Error(`Invalid package configuration file at "${configFilePath}": ` + e.message);