Skip to content

Commit ae5eb31

Browse files
committed
feat(@angular/cli): load reflect only on dev
`reflect-metadata` is not needed in AOT builds.
1 parent 0de9cb6 commit ae5eb31

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/@angular/cli/blueprints/ng/files/__path__/environments/environment.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
44
// The list of which env maps to which file can be found in `.angular-cli.json`.
55

6+
// Evergreen browsers require these polyfills on non-aot builds.
7+
// If you need to use `--prod --no-aot` you should transfer these over to `polyfills.ts`.
8+
import 'core-js/es6/reflect';
9+
import 'core-js/es7/reflect';
10+
611
export const environment = {
712
production: false
813
};

packages/@angular/cli/blueprints/ng/files/__path__/polyfills.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
4141

4242

43-
/** Evergreen browsers require these. **/
44-
import 'core-js/es6/reflect';
45-
import 'core-js/es7/reflect';
46-
47-
4843
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
4944
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
5045

@@ -70,3 +65,6 @@ import 'zone.js/dist/zone'; // Included with Angular CLI.
7065
* Need to import at least one locale-data with intl.
7166
*/
7267
// import 'intl/locale-data/jsonp/en';
68+
69+
// Each environment can have different polyfills as well.
70+
import './environments/environment';

0 commit comments

Comments
 (0)