Merge pull request #13054 from meteor/347-debug-mode

[3.0] Debug mode
This commit is contained in:
Nacho Codoñer
2024-03-12 19:14:37 +01:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

View File

@@ -667,6 +667,9 @@
- `Meteor.callAsync()`
- `meteor`:
- Added `Meteor.isDebug` to execute code in debug builds, activated with the --inspect mode.
- `minifier-css`: (2.9+)
- `CssTools.minifyCssAsync()`

View File

@@ -1,3 +1,19 @@
if (Meteor.isServer) {
if (typeof __meteor_runtime_config__ === 'object') {
__meteor_runtime_config__.debug =
!!process.env.NODE_INSPECTOR_IPC ||
!!process.env.VSCODE_INSPECTOR_OPTIONS ||
process.execArgv.some(function(_arg) {
return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(_arg);
});
}
}
Meteor.isDebug = Meteor.isClient
? typeof window === 'object' && !!window.__meteor_runtime_config__.debug
: typeof __meteor_runtime_config__ === 'object' &&
!!__meteor_runtime_config__.debug;
var suppress = 0;
// replacement for console.log. This is a temporary API. We should
@@ -61,4 +77,3 @@ Meteor._suppress_log = function (count) {
Meteor._suppressed_log_expected = function () {
return suppress !== 0;
};