mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 23:15:56 +08:00
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.
34 lines
1.1 KiB
TypeScript
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());
|
|
}
|
|
},
|
|
]);
|
|
};
|
|
}
|