Skip to content

Commit 893eef3

Browse files
JeanMecheAndrewKushnir
authored andcommitted
docs: update docs about prodMode. (#49745)
Following #49723, this commit updates the doc to reflect the actual message prompted in the console. PR Close #49745
1 parent fe34de4 commit 893eef3

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

aio/content/guide/deployment.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,31 +247,28 @@ The `production` configuration engages the following build optimization features
247247
| Features | Details |
248248
|:--- |:--- |
249249
| [Ahead-of-Time (AOT) Compilation](guide/aot-compiler) | Pre-compiles Angular component templates. |
250-
| [Production mode](#enable-prod-mode) | Deploys the production environment which enables *production mode*. |
250+
| [Production mode](#prod-mode) | Optimizes the application for the best runtime performance |
251251
| Bundling | Concatenates your many application and library files into a few bundles. |
252252
| Minification | Removes excess whitespace, comments, and optional tokens. |
253253
| Uglification | Rewrites code to use short, cryptic variable and function names. |
254254
| Dead code elimination | Removes unreferenced modules and much unused code. |
255255

256256
See [`ng build`](cli/build) for more about CLI build options and what they do.
257257

258-
<a id="enable-prod-mode"></a>
258+
<a id="prod-mode"></a>
259259

260-
### Enable runtime production mode
260+
### Production mode at runtime
261261

262-
In addition to build optimizations, Angular also has a runtime production mode.
263-
Angular applications run in development mode by default, as you can see by the following message on the browser console:
262+
When you run an application locally using `ng serve`, Angular uses the development mode configuration
263+
at runtime. The development mode at runtime enables extra safety checks, more detailed error messages
264+
and debugging utilities, such as the [expression-changed-after-checked](errors/NG0100) detection. Angular outputs
265+
a message in the browser console to indicate that the development mode is enabled.
264266

265-
<code-example format="output" hideCopy language="shell">
266-
267-
Angular is running in development mode.
268-
Call `enableProdMode()` to enable production mode.
267+
Those extra checks are helpful during the development, but they require an extra code in a bundle, which is
268+
undesirable in production. To ensure that there are no implications on the bundle size, the build optimizer
269+
removes the development-only code from the bundle when building in production mode.
269270

270-
</code-example>
271-
272-
*Production mode* improves application performance by disabling development-only safety checks and debugging utilities, such as the expression-changed-after-checked detection.
273271
Building your application with the production configuration automatically enables Angular's runtime production mode.
274-
275272
<a id="lazy-loading"></a>
276273

277274
### Lazy loading

0 commit comments

Comments
 (0)