October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Angular Workspace Configuration: How to Use angular.json

Angular’s root angular.json holds shared defaults and project-specific targets. Learn where to change a setting, how build and serve use targets, and which override wins.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Angular workspace settings live in the workspace-root angular.json. Shared defaults sit at the top level; each entry under projects can define project-specific settings and CLI targets such as build, serve, and test. To change one behavior safely, identify the project key and target first, then check that target’s builder schema for the Angular CLI and builder versions installed in your workspace.

Where is angular.json, and what does it configure?

Find angular.json at the root of an Angular workspace. It stores workspace-wide configuration and a projects object containing configuration for individual applications and libraries. Paths in the file are interpreted relative to the workspace root. The file is configuration, not a directory listing: a project’s logical name, its root value, and its physical folder are related but are not necessarily identical. Angular’s workspace configuration reference and file structure guide describe this layout.

As an Amazon Associate I earn from qualifying purchases.

A newly created application can live at the workspace root, while additional applications or libraries commonly live under projects/. Use the key in projects when addressing a project in CLI commands; do not assume that key is a folder path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do workspace and project settings relate?

Think of the configuration as layered defaults. Top-level properties provide shared settings, including CLI behavior and generation schematics. A project entry can specify properties such as root, projectType, sourceRoot, prefix, i18n, schematics, and architect. Where a project-specific setting overrides a shared default, the project value applies; a command-line value can in turn override configuration for that invocation.

For example, a shared schematic preference can establish a workspace default, while a project’s own schematics entry tailors generation for that project. Keep a setting at the workspace level when it should apply broadly; put it under the relevant project when projects need different behavior.

How do targets connect angular.json to CLI commands?

Within a project, the architect object defines named targets. A target identifies a builder and can contain base options plus named configurations. The builder determines what the target does and which options it accepts.

Command Configured target What to inspect
ng build The selected project’s build target Its builder, base options, and selected build configuration
ng serve The selected project’s serve target Its builder and server options, including any build configuration it uses
ng test The selected project’s test target Its builder and test options
ng run project:target The named target in the named project The target’s builder and options; useful for custom targets

Angular documents @angular/build:dev-server as the common serve builder. The serve target provides development-server behavior, including rebuilding and live reload; ng build invokes the project’s build target. See the official serve guide and build guide. Builder names and option schemas can vary, so check the schema associated with the builder installed in your workspace before relying on a particular option.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do configurations and overrides work?

A target’s options are its base values. Named entries under configurations supply variations, commonly production and development; a team can also define names such as staging. Select a named configuration with --configuration. Angular applies multiple comma-separated configurations from left to right, so when two set the same option, the later value wins.

ng build my-app --configuration=staging,fr

In this example, the staging configuration is applied first and fr second. If both configure the same property, the value from fr takes effect. This lets a team combine a shared deployment configuration with a locale-specific configuration, provided both names are defined for that target. Configuration names and availability are project-specific; they are not universal built-in environments.

For any single invocation, resolve a value in this order: target base options, the selected named configuration or configurations, then applicable command-line overrides. The exact supported command-line options still depend on the command and builder.

How can you inspect or change one setting?

  1. Start at the workspace root. Open angular.json and locate the relevant key under projects.
  2. Find the target. Follow the project entry to architect, then to the target such as build or serve. Identify whether the setting belongs in its base options or a named configurations entry.
  3. Check the installed builder schema. Confirm the builder and accepted option names and values for your installed CLI and builder version; the general documentation may not match every release.
  4. Read or set a JSON path with the CLI, or edit the file directly. For example, ng config projects.my-app.architect.build.options.outputPath reads that value. Add a value to set it: ng config projects.my-app.architect.build.options.outputPath dist/my-app. Replace my-app with the actual key from projects.
  5. Use camelCase in angular.json. Configuration keys use names such as outputPath; a corresponding command-line flag may use dash-case. Angular documents ng config in its CLI reference.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which build settings need particular care?

Build options commonly cover assets, styles, scripts, style preprocessor settings, file replacements, budgets, index behavior, source maps, optimization, and output paths. Their accepted shapes and meanings belong to the selected builder schema. In particular, asset paths and output locations are interpreted in context: consult the option descriptions rather than assuming every path is relative to the same directory. Angular’s workspace configuration reference notes that asset copying does not write outside the project output path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Source maps and deployment

Source-map settings can control details such as whether original source content is embedded. A hidden source map is not linked from the generated JavaScript bundles, but that alone does not make it private: if the generated map files are deployed and served, they may still be accessible. If maps should not be public, ensure your deployment does not publish or serve those files.

Production and development behavior

Production and development are named target configurations, not separate workspace files. Inspect the actual values in your project’s configuration before assuming what either name enables. For example, optimization and source-map behavior should be verified in the installed builder schema and the selected configuration rather than inferred from the label.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.