Skip to content

Commit 2dcd3f0

Browse files
committed
fix(polyfills): move polyfills to scripts array
Polyfills found in polyfills.ts would not be available for scripts due to being loaded in the main bundle only. Fix angular#2752 Fix angular#3309
1 parent 2a513ca commit 2dcd3f0

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed

packages/angular-cli/blueprints/ng2/files/__path__/main.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import './polyfills.ts';
2-
31
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
42
import { enableProdMode } from '@angular/core';
53
import { environment } from './environments/environment';

packages/angular-cli/blueprints/ng2/files/__path__/polyfills.ts

-19
This file was deleted.

packages/angular-cli/blueprints/ng2/files/__path__/test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import './polyfills.ts';
2-
31
import 'zone.js/dist/long-stack-trace-zone';
42
import 'zone.js/dist/proxy.js';
53
import 'zone.js/dist/sync-test';

packages/angular-cli/blueprints/ng2/files/angular-cli.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"styles": [
2121
"styles.<%= styleExt %>"
2222
],
23-
"scripts": [],
23+
"scripts": [
24+
"<%= relativeRootPath %>/node_modules/core-js/client/shim.min.js",
25+
"<%= relativeRootPath %>/node_modules/zone.js/dist/zone.js"
26+
],
2427
"environments": {
2528
"source": "environments/environment.ts",
2629
"dev": "environments/environment.ts",

tests/e2e/tests/test/test-scripts.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ export default function () {
6060
.then(() => expectToFail(() => ng('test', '--single-run')))
6161
.then(() => updateJsonFile('angular-cli.json', configJson => {
6262
const app = configJson['apps'][0];
63-
app['scripts'] = [
63+
app['scripts'] = app['scripts'].concat([
6464
'string-script.js',
6565
{ input: 'input-script.js' }
66-
];
66+
]);
6767
}))
6868
// should pass now
6969
.then(() => ng('test', '--single-run'));

0 commit comments

Comments
 (0)