angular-docs-cn/packages/compiler-cli/test/metadata
Paul Gschwendtner 105cfaf5e4 fix(compiler-cli): incorrect metadata bundle for multiple unnamed re-exports (#29360)
Currently if an Angular library has multiple unnamed module re-exports, NGC will
generate incorrect metdata if the project is using the flat-module bundle option.

e.g.

_public-api.ts_
```ts
export * from '@mypkg/secondary1';
export * from '@mypkg/secondary2';
```

There are clearly two unnamed re-exports in the `public-api.ts` file. NGC right now
accidentally overwrites all previous re-exports with the last one. Resulting in the
generated metadata only containing a reference to `@mypkg/secondary2`.

This is problematic as it is common for primary library entry-points to have
multiple re-exports (e.g. Material re-exporting all public symbols; or flex-layout
exporting all public symbols from their secondary entry-points).

Currently Angular Material works around this issue by manually creating
a metadata file that declares the re-exports from all unnamed re-exports.

(see: https://github.com/angular/material2/blob/master/tools/package-tools/build-release.ts#L78-L85)

This workaround works fine currently, but is no longer easily integrated when
building the package output with Bazel. In order to be able to build such
libraries with Bazel (Material/flex-layout), we need to make sure that NGC
generates the proper flat-module metadata bundle.

PR Close #29360
2019-03-18 15:08:40 -04:00
..
BUILD.bazel build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
bundler_spec.ts fix(compiler-cli): incorrect metadata bundle for multiple unnamed re-exports (#29360) 2019-03-18 15:08:40 -04:00
collector_spec.ts feat: add TypeScript 3 support (#25275) 2018-08-27 21:07:53 -04:00
evaluator_spec.ts feat: add TypeScript 3 support (#25275) 2018-08-27 21:07:53 -04:00
index_writer_spec.ts refactor(compiler): remove all source-level traces to tsc-wrapped (#18966) 2017-09-13 20:47:37 -04:00
symbols_spec.ts feat: add TypeScript 3 support (#25275) 2018-08-27 21:07:53 -04:00
typescript.mocks.ts feat: add TypeScript 3 support (#25275) 2018-08-27 21:07:53 -04:00