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`.
4610093c87/packages/core/src/util/ng_dev_mode.ts (L22)
which is currently not the case.
PR Close #40124
This commit is contained in:
parent
47d9b6d72d
commit
70b4816cd5
|
@ -6,6 +6,8 @@
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {global} from './global';
|
||||
|
||||
/**
|
||||
* This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.
|
||||
*
|
||||
|
@ -44,5 +46,12 @@ export function enableProdMode(): void {
|
|||
if (_runModeLocked) {
|
||||
throw new Error('Cannot enable prod mode after platform setup.');
|
||||
}
|
||||
|
||||
// The below check is there so when ngDevMode is set via terser
|
||||
// `global['ngDevMode'] = false;` is also dropped.
|
||||
if (typeof ngDevMode === undefined || !!ngDevMode) {
|
||||
global['ngDevMode'] = false;
|
||||
}
|
||||
|
||||
_devMode = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue