@@ -25,7 +25,11 @@ import {
2525} from '@angular-devkit/schematics' ;
2626import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks' ;
2727import { Schema as ComponentOptions } from '../component/schema' ;
28- import { NodeDependencyType , addPackageJsonDependency } from '../utility/dependencies' ;
28+ import {
29+ NodeDependencyType ,
30+ addPackageJsonDependency ,
31+ removePackageJsonDependency ,
32+ } from '../utility/dependencies' ;
2933import { latestVersions } from '../utility/latest-versions' ;
3034import { relativePathToWorkspaceRoot } from '../utility/paths' ;
3135import { getWorkspace , updateWorkspace } from '../utility/workspace' ;
@@ -132,6 +136,9 @@ function addDependenciesToPackageJson(options: ApplicationOptions) {
132136 if ( ! options . skipInstall ) {
133137 context . addTask ( new NodePackageInstallTask ( ) ) ;
134138 }
139+ if ( options . experimentalZoneless ) {
140+ removePackageJsonDependency ( host , 'zone.js' ) ;
141+ }
135142
136143 return host ;
137144 } ;
@@ -239,7 +246,7 @@ function addAppToWorkspaceFile(
239246 outputPath : `dist/${ folderName } ` ,
240247 index : `${ sourceRoot } /index.html` ,
241248 browser : `${ sourceRoot } /main.ts` ,
242- polyfills : [ 'zone.js' ] ,
249+ polyfills : options . experimentalZoneless ? [ ] : [ 'zone.js' ] ,
243250 tsConfig : `${ projectRoot } tsconfig.app.json` ,
244251 inlineStyleLanguage,
245252 assets : [ { 'glob' : '**/*' , 'input' : `${ projectRoot } public` } ] ,
@@ -279,7 +286,7 @@ function addAppToWorkspaceFile(
279286 : {
280287 builder : Builders . Karma ,
281288 options : {
282- polyfills : [ 'zone.js' , 'zone.js/testing' ] ,
289+ polyfills : options . experimentalZoneless ? [ ] : [ 'zone.js' , 'zone.js/testing' ] ,
283290 tsConfig : `${ projectRoot } tsconfig.spec.json` ,
284291 inlineStyleLanguage,
285292 assets : [ { 'glob' : '**/*' , 'input' : `${ projectRoot } public` } ] ,
0 commit comments