Skip to content

Commit

Permalink
feat: disabled ExperimentalWarning on prod builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Jan 15, 2023
1 parent c5a61a6 commit 984dec0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import TxAdmin from './txAdmin';
import logger from '@core/extras/console';
import { txEnv } from './globalData';
import { txEnv, convars } from './globalData';
import checkPreRelease from '@core/extras/checkPreRelease';
const { dir, log, logOk, logWarn, logError, setTTYTitle } = logger();

Expand Down Expand Up @@ -65,7 +65,10 @@ process.on('uncaughtException', function (err: Error) {
process.on('exit', (_code) => {
log('Stopping txAdmin');
});
// Error.stackTraceLimit = 25;
// process.on('warning', (warning) => {
// dir(warning);
// });
Error.stackTraceLimit = 25;
process.removeAllListeners('warning');
process.on('warning', (warning) => {
if(warning.name !== 'ExperimentalWarning' || convars.isDevMode){
dir(warning);
}
});

0 comments on commit 984dec0

Please sign in to comment.