Skip to content

Commit 922f492

Browse files
alan-agius4alxhub
authored andcommitted
fix(core): set ngDevMode to false when calling enableProdMode() (#40124)
The `ngDevMode` description also mentions that calling `enableProdMode` will set this the value to `false`. https://github.com/angular/angular/blob/4610093c87975b6355f31a9c849351129908783a/packages/core/src/util/ng_dev_mode.ts#L22 which is currently not the case. PR Close #40124
1 parent 0aa220b commit 922f492

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/core/src/util/is_dev_mode.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
import {global} from './global';
10+
911
/**
1012
* This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.
1113
*
@@ -44,5 +46,12 @@ export function enableProdMode(): void {
4446
if (_runModeLocked) {
4547
throw new Error('Cannot enable prod mode after platform setup.');
4648
}
49+
50+
// The below check is there so when ngDevMode is set via terser
51+
// `global['ngDevMode'] = false;` is also dropped.
52+
if (typeof ngDevMode === undefined || !!ngDevMode) {
53+
global['ngDevMode'] = false;
54+
}
55+
4756
_devMode = false;
4857
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy