Skip to content

Commit

Permalink
Disable moment deprecation warnings in production (elastic#170827)
Browse files Browse the repository at this point in the history
## Summary

Disable `momentjs` deprecation warnings in production environment to
avoid unexpected `console.log` entries.
  • Loading branch information
pgayvallet authored Nov 8, 2023
1 parent a173300 commit c834113
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
require('../setup_node_env/dist');
require('./apm')();
require('../setup_node_env/root');
require('../setup_node_env/mute_libraries');
require('./cli');
11 changes: 11 additions & 0 deletions src/setup_node_env/mute_libraries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

// disable moment deprecation warnings
var moment = require('moment');
moment.suppressDeprecationWarnings = true;

0 comments on commit c834113

Please sign in to comment.