Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 922f492

Browse filesBrowse 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
Copy full SHA for 922f492

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed

‎packages/core/src/util/is_dev_mode.ts

Copy file name to clipboardExpand all lines: packages/core/src/util/is_dev_mode.ts
+9Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.