From 9da63408b0a3ed388d3c94a6e81c82b7d7a0be5d Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Thu, 27 Apr 2017 14:29:11 -0700 Subject: [PATCH] fix(http): flatten metadata for @angular/http/testing @angular/http/testing used to publish a metadata structure which paralleled the .d.ts structure. This causes ngc to write incorrect imports for this bundle when compiling providers using MockBackend and other http testing classes. This change restructures the @angular/http/testing build a bit, modeling it after @angular/platform-browser-animations, and produces a FESM structure that has flat metadata. Fixes #15521. --- packages/http/testing/public_api.ts | 14 ++++++++++++++ packages/http/testing/tsconfig-build.json | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 packages/http/testing/public_api.ts diff --git a/packages/http/testing/public_api.ts b/packages/http/testing/public_api.ts new file mode 100644 index 0000000000..886eaecbc9 --- /dev/null +++ b/packages/http/testing/public_api.ts @@ -0,0 +1,14 @@ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +/** + * @module + * @description + * Entry point for all public APIs of the http testing package. + */ +export * from './src/testing'; diff --git a/packages/http/testing/tsconfig-build.json b/packages/http/testing/tsconfig-build.json index 2b7421fa40..7a18d963dc 100644 --- a/packages/http/testing/tsconfig-build.json +++ b/packages/http/testing/tsconfig-build.json @@ -8,9 +8,12 @@ } }, "files": [ - "index.ts" + "public_api.ts" ], "angularCompilerOptions": { - "strictMetadataEmit": true + "annotateForClosureCompiler": true, + "strictMetadataEmit": true, + "flatModuleOutFile": "index.js", + "flatModuleId": "@angular/http/testing" } }