Meta tags:
description= The web development framework for building modern apps.;
author= Angular Team;
keywords= Angular framework, TypeScript, web development, hydration, Signals, standalone components, accessibility, performance;
Headings (most frequently used words):
environment, specific, community, configuring, application, environments, on, this, page, angular, cli, configurations, configure, defaults, using, variables, in, your, app, social, media, resources, translations,
Text of the page (most frequently used words):
the (52), build (36), #environment (35), angular (30), configuration (29), environments (22), for (20), development (19), target (14), can (14), configurations (13), with (13), production (12), you (12), src (12), file (12), specific (12), and (11), staging (11), default (10), cli (10), this (8), your (8), options (7), use (7), files (7), app (6), serve (6), application (6), using (6), add (6), that (6), such (6), google (5), code (5), option (5), which (5), builder (5), http (5), new (5), developer (4), are (4), server (4), following (4), any (4), replace (4), targets (4), from (4), url (4), debug (4), v22 (3), when (3), set (3), defaultconfiguration (3), buildtarget (3), dev (3), uses (3), configure (3), command (3), filereplacements (3), json (3), replacements (3), contains (3), variables (3), apiurl (3), import (3), const (3), export (3), side (3), true (3), example (3), project (3), source (3), defaults (3), schematics (3), updated (3), licensed (2), under (2), style (2), community (2), youtube (2), used (2), directly (2), supports (2), create (2), then (2), replaced (2), version (2), sets (2), generate (2), main (2), each (2), prod (2), variable (2), defined (2), commands (2), have (2), components (2), false (2), content (2), values (2), client (2), page (2), secrets (2), specified (2), additional (2), object (2), base (2), directory (2), provides (2), start (2), generating (2), configuring (2), applied (2), sourcemap (2), maps (2), builders (2), named (2), test (2), different (2), tools (2), aot (2), errors (2), libraries (2), end (2), testing (2), apps (2), workers (2), service (2), animations (2), release (2), setup (2), docs (2), menu (2), super, powered, 2010, 2026, documentation, built, sha, 53ef99a, mit, license, 正體中文版, 简体中文版, 日本語版, 한국어, русский, türkçe, oʻzbekcha, français, español, azərbaycanca, translations, roadmap, press, kit, resources, experts, devlibrary, report, issues, conduct, contribute, stack, overflow, github, discord, bluesky, formerly, twitter, blog, social, media, specifies, not, without, modification, includes, also, targeted, run, more, well, overridden, copy, called, means, however, automatically, change, editing, section, lets, typescript, program, useful, including, fetch, fetches, component, ensures, find, must, original, bundled, into, visible, anyone, who, loads, never, store, api, keys, here, proxy, manager, instead, critical, further, either, properties, separate, objects, adds, settings, override, substituting, before, executing, combination, mechanism, data, customer, facing, multiple, comma, separator, order, conflicting, value, last, choose, enable, disable, map, generation, architect, projects, support, allows, overwriting, based, provided, line, back, top, arrow_upward_alt, apply, various, appropriate, versions, intended, define, metadata, ahead, time, compilation, template, type, checking, authoring, migrating, system, deployment, serving, building, local, overview, arrow_back, material, cdk, player, pay, fire, tailwind, custom, pipeline, web, pwas, rxjs, legacy, ngmodules, extended, ecosystem, v21, events, keeping, date, performance, unhandled, accessibility, security, guide, best, practices, language, devtools, webmcp, design, patterns, tutor, mcp, agent, skills, llm, prompts, ide, get, started, drag, drop, internationalization, aria, hybrid, rendering, forms, routing, dependency, injection, directives, templates, signals, depth, guides, coding, essentials, installation, what, introduction, more_horiz, reference, playground, tutorials, close, skip,
Text of the page (random words):
build environments angular skip to main content menu close v22 k docs tutorials playground reference more_horiz menu docs introduction what is angular installation essentials start coding in depth guides signals updated components templates directives dependency injection updated routing forms updated http client server side hybrid rendering testing angular aria new internationalization animations drag and drop build with ai get started llm prompts and ai ide setup agent skills new angular cli mcp server setup angular ai tutor design patterns webmcp new developer tools angular cli libraries devtools language service best practices style guide security accessibility unhandled errors in angular performance keeping up to date developer events angular v22 release new angular v21 release extended ecosystem ngmodules legacy animations using rxjs with angular service workers pwas web workers custom build pipeline tailwind angular fire google maps google pay youtube player angular cdk angular material arrow_back angular cli overview local set up building angular apps serving angular apps for development deployment end to end testing migrating to new build system build environments angular cli builders generating code using schematics authoring schematics schematics for libraries template type checking ahead of time aot compilation aot metadata errors developer tools angular cli configuring application environments you can define different named build configurations for your project such as development and staging with different defaults each named configuration can have defaults for any of the options that apply to the various builder targets such as build serve and test the angular cli build serve and test commands can then replace files with appropriate versions for your intended target environment on this page arrow_upward_alt back to the top angular cli configurations angular cli builders support a configurations object which allows overwriting specific options for a builder based on the configuration provided on the command line projects my app architect build builder angular build application options by default disable source map generation sourcemap false configurations for the debug configuration enable source maps debug sourcemap true you can choose which configuration to use with the configuration option ng build configuration debug configurations can be applied to any angular cli builder multiple configurations can be specified with a comma separator the configurations are applied in order with conflicting options using the value from the last configuration ng build configuration debug production customer facing configure environment specific defaults angular build application supports file replacements an option for substituting source files before executing a build using this in combination with configuration provides a mechanism for configuring environment specific data in your application start by generating environments to create the src environments directory and configure the project to use file replacements ng generate environments the project s src environments directory contains the base configuration file environment ts which provides the default configuration for production you can override default values for additional environments such as development and staging in target specific configuration files for example my app src environments environment development ts environment staging ts environment ts the base file environment ts contains the default environment settings for example export const environment production true the build command uses this as the build target when no environment is specified you can add further variables either as additional properties on the environment object or as separate objects for example the following adds a default for a variable to the default environment export const environment production true apiurl http my prod url critical files in src environments are bundled into your client side application and visible to anyone who loads the page never store secrets such as api keys here use a server side proxy or a secrets manager instead you can add target specific configuration files such as environment development ts the following content sets default values for the development build target export const environment production false apiurl http my dev url using environment specific variables in your app to use the environment configurations you have defined your components must import the original environments file import environment from environments environment this ensures that the build and serve commands can find the configurations for specific build targets the following code in the component file app ts uses an environment variable defined in the configuration files import environment from environments environment fetches from http my prod url in production http my dev url in development fetch environment apiurl the main cli configuration file angular json contains a filereplacements section in the configuration for each build target which lets you replace any file in the typescript program with a target specific version of that file this is useful for including target specific code or variables in a build that targets a specific environment such as production or staging by default no files are replaced however ng generate environments sets up this configuration automatically you can change or add file replacements for specific build targets by editing the angular json configuration directly configurations development filereplacements replace src environments environment ts with src environments environment development ts this means that when you build your development configuration with ng build configuration development the src environments environment ts file is replaced with the target specific version of the file src environments environment development ts to add a staging environment create a copy of src environments environment ts called src environments environment staging ts then add a staging configuration to angular json configurations development production staging filereplacements replace src environments environment ts with src environments environment staging ts you can add more configuration options to this target environment as well any option that your build supports can be overridden in a build target configuration to build using the staging configuration run the following command ng build configuration staging by default the build target includes production and development configurations and ng serve uses the development build of the application you can also configure ng serve to use the targeted build configuration if you set the buildtarget option serve builder angular build dev server options configurations development use the development configuration of the build target buildtarget my app build development production use the production configuration of the build target buildtarget my app build production defaultconfiguration development the defaultconfiguration option specifies which configuration is used by default when defaultconfiguration is not set options are used directly without modification social media blog x formerly twitter bluesky youtube discord github stack overflow community contribute code of conduct report issues google s devlibrary angular google developer experts resources press kit roadmap community translations azərbaycanca español français oʻzbekcha türkçe русский 한국어 日本語版 简体中文版 正體中文版 super powered by google 2010 2026 code licensed under an mit style license documentation licensed under cc by 4 0 built by angular at v22 3 0 sha 53ef99a
|