Skip to content
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

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

clydin
Copy link
Member

@clydin clydin commented Jul 8, 2024

The serve command will now use a default project target and builder name if the target entry is not explicitly defined. This allows the removal of additional configuration from an angular.json file. If the target is already present than it will take priority over any default builder behavior. The default logic will use the appropriate development server builder for officially supported packages (@angular/build/@angular-devkit/build-angular). The dev-server builder from these packages will currently assume a development configuration is present within the build target. The default behavior may be expanded in the future to support more arbitrary build target configurations. If there is third-party package usage within the build target, the CLI will attempt to discover a dev-server builder within the same package used by the build target. If none is found, no default will be added and the serve command will issue an error when no explicit target is present.

The `serve` command will now use a default project target and builder
name if the target entry is not explicitly defined. This allows the removal
of additional configuration from an `angular.json` file. If the target is
already present than it will take priority over any default builder behavior.
The default logic will use the appropriate development server builder for
officially supported packages (`@angular/build`/`@angular-devkit/build-angular`).
The `dev-server` builder from these packages will currently assume a `development`
configuration is present within the `build` target. The default behavior may
be expanded in the future to support more arbitrary `build` target configurations.
If there is third-party package usage within the `build` target, the CLI
will attempt to discover a `dev-server` builder within the same package used
by the `build` target. If none is found, no default will be added and the
`serve` command will issue an error when no explicit target is present.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jul 9, 2024
…on to be optional

The development server (`dev-server`) within `@angular/build` 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`.
@clydin clydin force-pushed the cli/default-workspace-targets branch from b63e0df to 7701ee6 Compare July 9, 2024 17:06
…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`.
@clydin clydin marked this pull request as ready for review July 10, 2024 14:42
@clydin clydin marked this pull request as draft July 10, 2024 17:32
@zygarios
Copy link

What about this PR? It's cool, and i hope it will be released with 19 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants