fix(ngcc): handle UMD re-exports (#34254)

In TS we can re-export imports using statements of the form:

```
export * from 'some-import';
```

This is downleveled in UMD to:

```
function factory(exports, someImport) {
  function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  }
  __export(someImport);
}
```

This commit adds support for this.

PR Close #34254
This commit is contained in:
Pete Bacon Darwin
2019-12-18 14:03:05 +00:00
committed by Kara Erickson
parent 47666f548c
commit e9fb5fdb89
4 changed files with 129 additions and 27 deletions

View File

@ -115,3 +115,7 @@ export function resolveFileWithPostfixes(
export function stripDollarSuffix(value: string): string {
return value.replace(/\$\d+$/, '');
}
export function stripExtension(fileName: string): string {
return fileName.replace(/\..+$/, '');
}