@umijs/bundler-webpack 4.0.57 → 4.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,7 +114,8 @@ socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_r
114
114
  }
115
115
  }, _callee2);
116
116
  })));
117
- ErrorOverlay.startReportingRuntimeErrors({
117
+ var enableErrorOverlay = process.env.ERROR_OVERLAY !== 'none';
118
+ enableErrorOverlay && ErrorOverlay.startReportingRuntimeErrors({
118
119
  onError: function onError() {
119
120
  hadRuntimeError = true;
120
121
  },
@@ -126,7 +127,7 @@ if (module.hot && typeof module.hot.dispose === 'function') {
126
127
  // @ts-ignore
127
128
  module.hot.dispose(function () {
128
129
  // TODO: why do we need this?
129
- ErrorOverlay.stopReportingRuntimeErrors();
130
+ enableErrorOverlay && ErrorOverlay.stopReportingRuntimeErrors();
130
131
  });
131
132
  }
132
133
 
@@ -144,7 +145,7 @@ function handleSuccess() {
144
145
  if (isHotUpdate) {
145
146
  tryApplyUpdates(function onHotUpdateSuccess() {
146
147
  // Only dismiss it when we're sure it's a hot update.
147
- // Otherwise it would flicker right before the reload.
148
+ // Otherwise, it would flicker right before the reload.
148
149
  tryDismissErrorOverlay();
149
150
  });
150
151
  }
@@ -173,7 +174,7 @@ function handleWarnings(warnings) {
173
174
  if (isHotUpdate) {
174
175
  tryApplyUpdates(function onSuccessfulHotUpdate() {
175
176
  // Only dismiss it when we're sure it's a hot update.
176
- // Otherwise it would flicker right before the reload.
177
+ // Otherwise, it would flicker right before the reload.
177
178
  tryDismissErrorOverlay();
178
179
  });
179
180
  }
@@ -187,7 +188,7 @@ function handleErrors(errors) {
187
188
  });
188
189
 
189
190
  // Only show the first error.
190
- ErrorOverlay.reportBuildError(formatted.errors[0]);
191
+ enableErrorOverlay && ErrorOverlay.reportBuildError(formatted.errors[0]);
191
192
 
192
193
  // Also log them to the console.
193
194
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
@@ -198,7 +199,7 @@ function handleErrors(errors) {
198
199
  }
199
200
  function tryDismissErrorOverlay() {
200
201
  if (!hasCompileErrors) {
201
- ErrorOverlay.dismissBuildError();
202
+ enableErrorOverlay && ErrorOverlay.dismissBuildError();
202
203
  }
203
204
  }
204
205