Alan Agius 4203294d53 feat(@schematics/angular): add migration for applications tsconfigs
This migration updates the current tsconfig for the applications in two ways.

1) removes `enableIvy: true` option since it's by default true.
2) Amends the files/exclude/include options to only include files that are needed in the compilation.
2019-09-05 00:26:07 +05:30

34 lines
1.1 KiB
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Rule, chain } from '@angular-devkit/schematics';
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
import { updateLibraries } from './ivy-libraries';
import { updateNGSWConfig } from './ngsw-config';
import { updateApplicationTsConfigs } from './update-app-tsconfigs';
import { updateDependencies } from './update-dependencies';
import { updateWorkspaceConfig } from './update-workspace-config';
export default function(): Rule {
return () => {
return chain([
updateWorkspaceConfig(),
updateLibraries(),
updateNGSWConfig(),
updateApplicationTsConfigs(),
updateDependencies(),
(tree, context) => {
const packageChanges = tree.actions.some(a => a.path.endsWith('/package.json'));
if (packageChanges) {
context.addTask(new NodePackageInstallTask());
}
},
]);
};
}