fix(ngcc): ensure that more dependencies are found by EsmDependencyHost (#37075)

Previously this host was skipping files if they had imports that spanned
multiple lines, or if the import was a dynamic import expression.

PR Close #37075
This commit is contained in:
Pete Bacon Darwin
2020-06-04 08:43:04 +01:00
committed by atscott
parent 819982ea20
commit c6872c02d8
2 changed files with 28 additions and 4 deletions

View File

@ -93,7 +93,7 @@ export class EsmDependencyHost extends DependencyHostBase {
* in this file, true otherwise.
*/
export function hasImportOrReexportStatements(source: string): boolean {
return /(import|export)\s.+from/.test(source);
return /(?:import|export)[\s\S]+?(["'])(?:(?:\\\1|.)*?)\1/.test(source);
}