What is @angular/cli?
The @angular/cli package is a command-line interface tool that you can use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell. It provides commands for creating new projects, generating application and library code, performing a variety of ongoing development tasks such as testing, bundling, and deployment.
What are @angular/cli's main functionalities?
Project Scaffolding
Creates a new Angular application with a default structure by running the 'ng new' command followed by the project name.
ng new my-angular-app
Generating Components, Services, and other features
Generates a new component and its associated files by using the 'ng generate' command followed by the feature type and name.
ng generate component my-component
Building and Serving the Application
Compiles the application and starts a web server, making the app accessible in a browser. The 'ng serve' command is used for this purpose.
ng serve
Running Unit Tests
Executes the unit tests defined in the application using the 'ng test' command.
ng test
Building for Production
Compiles the application for production deployment, optimizing the build for performance and size using the 'ng build' command with the '--prod' flag.
ng build --prod
Other packages similar to @angular/cli
create-react-app
Similar to @angular/cli, create-react-app is a command-line interface for setting up new React applications. It abstracts away build configuration to a pre-configured setup, allowing developers to focus on writing code. Unlike @angular/cli, it is tailored specifically for React and does not provide an extensive set of generation commands.
vue-cli
Vue CLI is a full system for rapid Vue.js development, similar to @angular/cli for Angular. It provides project scaffolding, a development server, build tools, and a set of plugins for common tasks. Vue CLI is designed for Vue.js and offers a similar level of functionality for Vue developers.
ember-cli
Ember CLI is a command-line utility for creating, developing, and building Ember.js applications. It provides a standardized development structure and build pipeline, much like @angular/cli does for Angular. Ember CLI focuses on Ember.js and has a strong emphasis on convention over configuration.
Angular CLI - The CLI tool for Angular.
The sources for this package are in the Angular CLI repository. Please file issues and pull requests against that repository.
Usage information and reference details can be found in repository README file.
19.1.0-next.1 (2024-12-12)
Deprecations
@angular/build
-
The baseHref
option under i18n.locales
and i18n.sourceLocale
in angular.json
is deprecated in favor of subPath
.
The subPath
defines the URL segment for the locale, serving as both the HTML base HREF and the directory name for output. By default, if not specified, subPath
will use the locale code.
@angular-devkit/architect
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ---------------------------------- |
| 2b8a02bac | feat | require build schemas from modules |
@angular-devkit/build-angular
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | -------------------------------------- |
| fb41d182e | fix | fix webpack config transform for karma |
| 9e2d3fbd1 | fix | handle windows spec collisions |
@angular/build
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------- |
| 0a570c0c2 | feat | add support for customizing URL segments with i18n |
| 210bf4e2b | fix | Fixing auto-csp edge cases where |
| d811a7ffb | fix | handle external @angular/
packages during SSR (#29094) |
| 64f32c769 | fix | provide component HMR update modules to dev-server SSR |
| c832bac9b | fix | show error when Node.js built-ins are used during ng serve
|
| 887599822 | fix | use consistent path separators for template HMR identifiers |
| 75998ebab | perf | reuse TS package.json cache when rebuilding |
@angular/ssr
| Commit | Type | Description |
| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------------------------------------------- |
| 8d7a51dfc | feat | add modulepreload
for lazy-loaded routes |
| 41ece633b | feat | redirect to preferred locale when accessing root route without a specified locale |
| d7214e961 | fix | include Content-Language
header when locale is set |
| 10a5b8b6b | fix | disable component bootstrapping during route extraction |
<!-- CHANGELOG SPLIT MARKER -->
<a name="19.0.5"></a>