mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Merge pull request #1599 from atmire/w2p-90797_issue-1430_redux-devtools-disable-support-in-prod-mode
Disable redux devtools support in prod mode
This commit is contained in:
@@ -79,6 +79,10 @@
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.production.ts"
|
||||
},
|
||||
{
|
||||
"replace": "src/config/store/devtools.ts",
|
||||
"with": "src/config/store/devtools.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
@@ -204,6 +208,10 @@
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.production.ts"
|
||||
},
|
||||
{
|
||||
"replace": "src/config/store/devtools.ts",
|
||||
"with": "src/config/store/devtools.prod.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
import { RouterStateSerializer, StoreRouterConnectingModule } from '@ngrx/router-store';
|
||||
import { MetaReducer, Store, StoreModule, USER_PROVIDED_META_REDUCERS } from '@ngrx/store';
|
||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||
import {
|
||||
DYNAMIC_ERROR_MESSAGES_MATCHER,
|
||||
DYNAMIC_MATCHER_PROVIDERS,
|
||||
@@ -61,6 +60,8 @@ import { ThemedAdminSidebarComponent } from './admin/admin-sidebar/themed-admin-
|
||||
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
|
||||
import { NgxMaskModule } from 'ngx-mask';
|
||||
|
||||
import { StoreDevModules } from '../config/store/devtools';
|
||||
|
||||
export function getConfig() {
|
||||
return environment;
|
||||
}
|
||||
@@ -96,15 +97,9 @@ const IMPORTS = [
|
||||
StoreModule.forRoot(appReducers, storeModuleConfig),
|
||||
StoreRouterConnectingModule.forRoot(),
|
||||
ThemedEntryComponentModule.withEntryComponents(),
|
||||
StoreDevModules,
|
||||
];
|
||||
|
||||
IMPORTS.push(
|
||||
StoreDevtoolsModule.instrument({
|
||||
maxAge: 1000,
|
||||
logOnly: environment.production,
|
||||
})
|
||||
);
|
||||
|
||||
const PROVIDERS = [
|
||||
{
|
||||
provide: APP_CONFIG,
|
||||
|
4
src/config/store/devtools.prod.ts
Normal file
4
src/config/store/devtools.prod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* This disabled DevTools in Production mode, overriding the defaults in devtools.ts
|
||||
*/
|
||||
export const StoreDevModules = [];
|
10
src/config/store/devtools.ts
Normal file
10
src/config/store/devtools.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
||||
|
||||
export const StoreDevModules = [
|
||||
// This enables Redux DevTools by default.
|
||||
// Note: this is overridden in production by devtools.prod.ts
|
||||
StoreDevtoolsModule.instrument({
|
||||
maxAge: 1000,
|
||||
logOnly: false,
|
||||
})
|
||||
];
|
Reference in New Issue
Block a user