AngularJson File Exploring
AngularJson File Exploring
json File
In Angular 18
2. "version"
"version": 1
❖ Represents the Angular CLI version that generated this file.
3. "newProjectRoot"
"newProjectRoot": "projects"
❖ When you create a new project inside this workspace, it will be placed in the "projects"
folder.
4. "projects"
Defines configuration settings for each Angular project within the workspace.
In this case, there's only one project: SaiReddyChatApp.
"projects": {
"SaiReddyChatApp": {
• The project name "SaiReddyChatApp" is used in CLI commands like ng build
SaiReddyChatApp.
5. "projectType"
"projectType": "application"
• Specifies whether this is an application or library.
• Applications are runnable, whereas libraries are reusable code.
7. "prefix"
"prefix": "app"
• Used as a prefix for component selectors (e.g., <app-component>).
• Can be changed based on project needs.
Sai Reddy
saireddy-dotnetfs
Architect Section (Defines build, serve, test configurations)
8. . "build" → Defines how the app is built
"build": {
"builder": "@angular-devkit/build-angular:application",
• Specifies that the Angular DevKit will be used to build the app.
Sai Reddy
saireddy-dotnetfs
9. "configurations" → Build Profiles
Defines different build environments.
"production" → Optimized for deployment
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
• Performance budget warnings for large files.
"outputHashing": "all"
• Enables cache-busting by appending hashes to filenames.
"development" → For local development
"optimization": false,
"extractLicenses": false,
"sourceMap": true
• Optimization disabled for faster rebuilds.
• Source maps enabled for debugging.
10. "serve" → Development Server Settings
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
• Runs ng serve to start a local development server.
"configurations"
"production": {
"buildTarget": "SaiReddyChatApp:build:production"
},
"development": {
"buildTarget": "SaiReddyChatApp:build:development"
}
• Specifies which build configuration should be used when running ng serve --
configuration=production.
"defaultConfiguration": "development"
• Default mode is development when running ng serve.
11. "extract-i18n" → Internationalization Extraction
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
}
• Extracts translations for multi-language support.
Sai Reddy
saireddy-dotnetfs
12. "test" → Unit Testing Configuration
"test": {
"builder": "@angular-devkit/build-angular:karma",
• Uses Karma as the test runner.
"polyfills": [
"zone.js",
"zone.js/testing"
],
• Polyfills required for running tests.
"tsConfig": "tsconfig.spec.json",
• Uses tsconfig.spec.json for TypeScript settings in tests.
"assets": [
{
"glob": "**/*",
"input": "public"
}
]
• Includes static files in test runs.
"styles": [
"@angular/material/prebuilt-themes/azure-blue.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
]
• Loads global styles and Bootstrap scripts for tests.
Sai Reddy
saireddy-dotnetfs