mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 04:26:01 +08:00
Previous versions rely on `this` which breaks differential loading since it's `undefined` when using script tags with type module. Fixes #14518
37 lines
1.2 KiB
TypeScript
37 lines
1.2 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 { updatePackageJson, updateTsLintConfig } from './codelyzer-5';
|
|
import { updateES5Projects } from './differential-loading';
|
|
import { dropES2015Polyfills } from './drop-es6-polyfills';
|
|
import { removeAngularHttp } from './remove-angular-http';
|
|
import { updateDependencies } from './update-dependencies';
|
|
|
|
export { updateLazyModulePaths } from './update-lazy-module-paths';
|
|
|
|
export default function(): Rule {
|
|
return () => {
|
|
return chain([
|
|
updateTsLintConfig(),
|
|
updatePackageJson(),
|
|
dropES2015Polyfills(),
|
|
updateES5Projects(),
|
|
updateDependencies(),
|
|
removeAngularHttp(),
|
|
(tree, context) => {
|
|
const packageChanges = tree.actions.some(a => a.path.endsWith('/package.json'));
|
|
if (packageChanges) {
|
|
context.addTask(new NodePackageInstallTask());
|
|
}
|
|
},
|
|
]);
|
|
};
|
|
}
|