Skip to content

Commit c04dbbe

Browse files
committed
feat(@schematics/angular): move the reflect-metadata import to dev environment
It is not used in AOT with Angular. Only if you use a library that needs them.
1 parent c3cffc3 commit c04dbbe

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/schematics/angular/application/files/src/environments/environment.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
33
// The list of file replacements can be found in `angular.json`.
44

5+
// Used for reflect-metadata in JIT. For size and performance reasons, this should not be imported
6+
// in AOT unless absolutely needed. All Angular metadata is removed in AOT so this is only needed,
7+
// by default, in development.
8+
import 'core-js/es7/reflect';
9+
510
export const environment = {
611
production: false
712
};

packages/schematics/angular/application/files/src/polyfills.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@
4242

4343

4444
/** Evergreen browsers require these. **/
45-
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46-
import 'core-js/es7/reflect';
47-
48-
4945
/**
5046
* Web Animations `@angular/platform-browser/animations`
5147
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.

0 commit comments

Comments
 (0)