Skip to content

Commit 1504352

Browse files
committed
feat(@schematics/angular): drop polyfills.ts file from new templates
With this change we drop the `polyfills.ts` from new application projects and add the polyfills directly in the `angular.json`. This is possible as now the `polyfills` option accept an array of module specifiers. This change also fixes another open issue (#14432) which was caused by the missing polyfills file in the library test setup. Closes #14432
1 parent e634ff7 commit 1504352

File tree

1 file changed

+4
-0
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+4
-0
lines changed

packages/angular_devkit/build_angular/src/webpack/configs/common.ts

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
116116
// This is because the jasmine functions such as beforeEach/it will not be patched by zone.js since
117117
// jasmine will not be loaded yet, so the ProxyZone will not be there. We have to load zone-testing.js after
118118
// jasmine is ready.
119+
// We could force loading 'zone.js/testing' prior to jasmine by changing the order of scripts in 'karma-context.html'.
120+
// But this has it's own problems as zone.js needs to be loaded prior to jasmine due to patching of timing functions
121+
// See: https://github.com/jasmine/jasmine/issues/1944
122+
// Thus the correct order is zone.js -> jasmine -> zone.js/testing.
119123
const zoneTestingEntryPoint = 'zone.js/testing';
120124
const polyfillsExludingZoneTesting = polyfills.filter((p) => p !== zoneTestingEntryPoint);
121125

0 commit comments

Comments
 (0)