Skip to content

refactor(@angular/cli): provide default serve target for applications #28011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor(@angular-devkit/build-angular): allow development server `bu…
…ildTarget` option to be optional

The development server (`dev-server`) within `@angular-devkit/build-angular` no longer
requires a `buildTarget` option to be specified. If not present, the value
will default to the current project's 'build' target. The configuration used
for the build target will be the same as the development server configuration
if specified or, if not specified, it will default to `development`.
  • Loading branch information
clydin committed Mar 19, 2025
commit 7c488704a3befa4992cba84ac6ed0ec8f25e30f3
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,5 @@
]
}
},
"additionalProperties": false,
"required": ["buildTarget"]
"additionalProperties": false
}
Loading