Skip to content

Commit 424a949

Browse files
committed
fix(@schematics/angular): application migration should migrate karma builder package
The `use-application-builder` update migration will now attempt to migrate the `karma` builder to use the `@angular/build` package if no other `@angular-devkit/build-angular` usage is present.
1 parent f669657 commit 424a949

File tree

1 file changed

+8
-0
lines changed
  • packages/schematics/angular/migrations/use-application-builder

1 file changed

+8
-0
lines changed

packages/schematics/angular/migrations/use-application-builder/migration.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ function updateProjects(tree: Tree, context: SchematicContext) {
217217
case Builders.Application:
218218
case Builders.DevServer:
219219
case Builders.ExtractI18n:
220+
case Builders.Karma:
220221
case Builders.NgPackagr:
221222
// Ignore application, dev server, and i18n extraction for devkit usage check.
222223
// Both will be replaced if no other usage is found.
@@ -242,6 +243,13 @@ function updateProjects(tree: Tree, context: SchematicContext) {
242243
case Builders.ExtractI18n:
243244
target.builder = '@angular/build:extract-i18n';
244245
break;
246+
case Builders.Karma:
247+
target.builder = '@angular/build:karma';
248+
// Remove "builderMode" option since the builder will always use "application"
249+
for (const [, karmaOptions] of allTargetOptions(target)) {
250+
delete karmaOptions['builderMode'];
251+
}
252+
break;
245253
case Builders.NgPackagr:
246254
target.builder = '@angular/build:ng-packagr';
247255
break;

0 commit comments

Comments
 (0)