From 717df132077d5bea378653f963cd613d6a15b987 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 8 Apr 2020 19:34:19 +0100 Subject: [PATCH] fix(ngcc): do not warn if `paths` mapping does not exist (#36525) In cc4b813e759f16fb0f4dfa92a0e6464ed768a629 the `getBasePaths()` function was changed to log a warning if a `basePath()` computed from the `paths` mappings did not exist. It turns out this is a common and accepted scenario, so we should not log warnings in this case. Fixes #36518 PR Close #36525 --- packages/compiler-cli/ngcc/src/entry_point_finder/utils.ts | 2 +- .../compiler-cli/ngcc/test/entry_point_finder/utils_spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/compiler-cli/ngcc/src/entry_point_finder/utils.ts b/packages/compiler-cli/ngcc/src/entry_point_finder/utils.ts index 67f2a2f332..ff0da04edd 100644 --- a/packages/compiler-cli/ngcc/src/entry_point_finder/utils.ts +++ b/packages/compiler-cli/ngcc/src/entry_point_finder/utils.ts @@ -50,7 +50,7 @@ export function getBasePaths( if (fs.exists(basePath)) { basePaths.push(basePath); } else { - logger.warn( + logger.debug( `The basePath "${basePath}" computed from baseUrl "${baseUrl}" and path mapping "${ path}" does not exist in the file-system.\n` + `It will not be scanned for entry-points.`); diff --git a/packages/compiler-cli/ngcc/test/entry_point_finder/utils_spec.ts b/packages/compiler-cli/ngcc/test/entry_point_finder/utils_spec.ts index 840a3e1b45..41b893c9e2 100644 --- a/packages/compiler-cli/ngcc/test/entry_point_finder/utils_spec.ts +++ b/packages/compiler-cli/ngcc/test/entry_point_finder/utils_spec.ts @@ -115,7 +115,7 @@ runInEachFileSystem(() => { ]); }); - it('should discard basePaths that do not exists and log a warning', () => { + it('should discard basePaths that do not exists and log a debug message', () => { const projectDirectory = _('/path/to/project'); const fs = getFileSystem(); fs.ensureDir(fs.resolve(projectDirectory, 'dist-1')); @@ -131,7 +131,7 @@ runInEachFileSystem(() => { sourceDirectory, fs.resolve(projectDirectory, 'dist-1'), ]); - expect(logger.logs.warn).toEqual([ + expect(logger.logs.debug).toEqual([ [`The basePath "${ fs.resolve(projectDirectory, 'sub-folder/dist-2')}" computed from baseUrl "${ projectDirectory}" and path mapping "sub-folder/dist-2" does not exist in the file-system.\n` +