forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-workspace-config.ts
32 lines (29 loc) · 1.16 KB
/
update-workspace-config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @license
* Copyright Google LLC 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 { removePackageJsonDependency } from '../../utility/dependencies';
import { allTargetOptions, updateWorkspace } from '../../utility/workspace';
import { Builders, ProjectType } from '../../utility/workspace-models';
export default function (): Rule {
return updateWorkspace((workspace) => {
for (const [, project] of workspace.projects) {
if (project.extensions.projectType !== ProjectType.Application) {
// Only interested in application projects since these changes only effects application builders
continue;
}
for (const [, target] of project.targets) {
if (target.builder === Builders.ExtractI18n || target.builder === Builders.DevServer) {
for (const [, options] of allTargetOptions(target, false)) {
options['buildTarget'] = options['browserTarget'];
delete options['browserTarget'];
}
}
}
}
});
}