diff --git a/packages/angular/build/src/builders/dev-server/options.ts b/packages/angular/build/src/builders/dev-server/options.ts index 080e168699bc..e342416e0695 100644 --- a/packages/angular/build/src/builders/dev-server/options.ts +++ b/packages/angular/build/src/builders/dev-server/options.ts @@ -36,8 +36,10 @@ export async function normalizeOptions( const cacheOptions = normalizeCacheOptions(projectMetadata, workspaceRoot); - // Target specifier defaults to the current project's build target using a development configuration - const buildTargetSpecifier = options.buildTarget ?? `::development`; + // Target specifier defaults to the current project's build target using the provided dev-server + // configuration if a configuration is present or the 'development' configuration if not. + const buildTargetSpecifier = + options.buildTarget ?? `::${context.target?.configuration || 'development'}`; const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build'); // Get the application builder options. diff --git a/packages/angular/build/src/builders/dev-server/schema.json b/packages/angular/build/src/builders/dev-server/schema.json index 3adce45eb71a..8bc0fc4dc4ff 100644 --- a/packages/angular/build/src/builders/dev-server/schema.json +++ b/packages/angular/build/src/builders/dev-server/schema.json @@ -111,5 +111,5 @@ } }, "additionalProperties": false, - "required": ["buildTarget"] + "required": [] }