Skip to content

Commit c557a19

Browse files
committed
fix(@schematics/angular): avoid empty polyfill option for new zoneless application
To reduce the size of the initial `angular.json` for applications, newly generated zoneless applications will no longer contain an explicit empty `polyfills` option. The option can still be added and is available for use if needed by an application but the empty array value will no longer be present when generating a zoneless application. This has no effect for applications using Zone.js (default).
1 parent 100571f commit c557a19

File tree

1 file changed

+2
-2
lines changed
  • packages/schematics/angular/application

1 file changed

+2
-2
lines changed

packages/schematics/angular/application/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function addAppToWorkspaceFile(
258258
options: {
259259
index: `${sourceRoot}/index.html`,
260260
browser: `${sourceRoot}/main.ts`,
261-
polyfills: options.zoneless ? [] : ['zone.js'],
261+
polyfills: options.zoneless ? undefined : ['zone.js'],
262262
tsConfig: `${projectRoot}tsconfig.app.json`,
263263
inlineStyleLanguage,
264264
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],
@@ -297,7 +297,7 @@ function addAppToWorkspaceFile(
297297
: {
298298
builder: Builders.BuildKarma,
299299
options: {
300-
polyfills: options.zoneless ? [] : ['zone.js', 'zone.js/testing'],
300+
polyfills: options.zoneless ? undefined : ['zone.js', 'zone.js/testing'],
301301
tsConfig: `${projectRoot}tsconfig.spec.json`,
302302
inlineStyleLanguage,
303303
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],

0 commit comments

Comments
 (0)