@umijs/bundler-webpack 4.0.50 → 4.0.52

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.
Files changed (46) hide show
  1. package/client/client/client.js +33 -71
  2. package/compiled/webpack/BasicEvaluatedExpression.js +1 -0
  3. package/compiled/webpack/ExternalsPlugin.js +1 -0
  4. package/compiled/webpack/FetchCompileAsyncWasmPlugin.js +1 -0
  5. package/compiled/webpack/FetchCompileWasmPlugin.js +1 -0
  6. package/compiled/webpack/LimitChunkCountPlugin.js +1 -0
  7. package/compiled/webpack/NodeTargetPlugin.js +1 -0
  8. package/compiled/webpack/NodeTemplatePlugin.js +1 -0
  9. package/compiled/webpack/StringXor.js +1 -0
  10. package/compiled/webpack/WebWorkerTemplatePlugin.js +1 -0
  11. package/compiled/webpack/deepImports.json +10 -1
  12. package/compiled/webpack/index.js +2796 -2728
  13. package/compiled/webpack/package.json +5 -1
  14. package/dist/build.d.ts +1 -0
  15. package/dist/build.js +22 -5
  16. package/dist/cli.js +4 -0
  17. package/dist/config/bundleAnalyzerPlugin.js +1 -0
  18. package/dist/config/compressPlugin.js +5 -0
  19. package/dist/config/config.js +10 -2
  20. package/dist/config/copyPlugin.js +2 -0
  21. package/dist/config/cssRules.js +7 -0
  22. package/dist/config/detectDeadCode.js +4 -0
  23. package/dist/config/detectDeadCodePlugin.js +4 -0
  24. package/dist/config/fastRefreshPlugin.js +4 -0
  25. package/dist/config/forkTSCheckerPlugin.js +4 -0
  26. package/dist/config/javaScriptRules.js +19 -0
  27. package/dist/config/miniCSSExtractPlugin.js +8 -1
  28. package/dist/config/progressPlugin.js +4 -0
  29. package/dist/config/speedMeasureWebpackPlugin.js +4 -0
  30. package/dist/config/svgRules.js +4 -0
  31. package/dist/dev.d.ts +6 -0
  32. package/dist/dev.js +31 -18
  33. package/dist/loader/svgr.js +4 -0
  34. package/dist/loader/swc.js +7 -0
  35. package/dist/parcelCSS.d.ts +1 -1
  36. package/dist/parcelCSS.js +5 -1
  37. package/dist/requireHook.js +4 -0
  38. package/dist/schema.js +1 -0
  39. package/dist/server/server.js +6 -0
  40. package/dist/server/ws.d.ts +1 -1
  41. package/dist/server/ws.js +4 -0
  42. package/dist/swcPlugins/autoCSSModules.js +9 -0
  43. package/dist/swcPlugins/lockCoreJS.js +4 -0
  44. package/dist/utils/depMatch.js +2 -1
  45. package/dist/utils/formatWebpackMessages.js +4 -0
  46. package/package.json +6 -6
@@ -1,38 +1,29 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
5
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
-
7
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
-
9
- import stripAnsi from '@umijs/utils/compiled/strip-ansi'; // @ts-ignore
10
-
5
+ import stripAnsi from '@umijs/utils/compiled/strip-ansi';
6
+ // @ts-ignore
11
7
  import * as ErrorOverlay from 'react-error-overlay';
12
8
  import { MESSAGE_TYPE } from "../constants";
13
9
  import { formatWebpackMessages } from "../utils/formatWebpackMessages";
14
10
  console.log('[webpack] connecting...');
15
-
16
11
  function getHost() {
17
12
  if (process.env.SOCKET_SERVER) {
18
13
  return new URL(process.env.SOCKET_SERVER);
19
14
  }
20
-
21
15
  return location;
22
16
  }
23
-
24
17
  function getSocketUrl() {
25
18
  var h = getHost();
26
19
  var host = h.host;
27
20
  var isHttps = h.protocol === 'https:';
28
21
  return "".concat(isHttps ? 'wss' : 'ws', "://").concat(host);
29
22
  }
30
-
31
23
  function getPingUrl() {
32
24
  var h = getHost();
33
25
  return "".concat(h.protocol, "//").concat(h.host, "/__umi_ping");
34
26
  }
35
-
36
27
  var pingTimer = null;
37
28
  var isFirstCompilation = true;
38
29
  var mostRecentCompilationHash = null;
@@ -49,18 +40,16 @@ socket.addEventListener('message', /*#__PURE__*/function () {
49
40
  case 0:
50
41
  data = _ref.data;
51
42
  data = JSON.parse(data);
52
-
53
43
  if (data.type === 'connected') {
54
- console.log("[webpack] connected."); // proxy(nginx, docker) hmr ws maybe caused timeout,
44
+ console.log("[webpack] connected.");
45
+ // proxy(nginx, docker) hmr ws maybe caused timeout,
55
46
  // so send ping package let ws keep alive.
56
-
57
47
  pingTimer = window.setInterval(function () {
58
48
  return socket.send('ping');
59
49
  }, 30000);
60
50
  } else {
61
51
  handleMessage(data).catch(console.error);
62
52
  }
63
-
64
53
  case 3:
65
54
  case "end":
66
55
  return _context.stop();
@@ -68,39 +57,32 @@ socket.addEventListener('message', /*#__PURE__*/function () {
68
57
  }
69
58
  }, _callee);
70
59
  }));
71
-
72
60
  return function (_x) {
73
61
  return _ref2.apply(this, arguments);
74
62
  };
75
63
  }());
76
-
77
64
  function waitForSuccessfulPing() {
78
65
  return _waitForSuccessfulPing.apply(this, arguments);
79
66
  }
80
-
81
67
  function _waitForSuccessfulPing() {
82
68
  _waitForSuccessfulPing = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
83
69
  var ms,
84
- _args3 = arguments;
70
+ _args3 = arguments;
85
71
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
86
72
  while (1) {
87
73
  switch (_context3.prev = _context3.next) {
88
74
  case 0:
89
75
  ms = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : 1000;
90
-
91
76
  case 1:
92
77
  if (!true) {
93
78
  _context3.next = 14;
94
79
  break;
95
80
  }
96
-
97
81
  _context3.prev = 2;
98
82
  _context3.next = 5;
99
83
  return fetch(pingUrl);
100
-
101
84
  case 5:
102
85
  return _context3.abrupt("break", 14);
103
-
104
86
  case 8:
105
87
  _context3.prev = 8;
106
88
  _context3.t0 = _context3["catch"](2);
@@ -108,11 +90,9 @@ function _waitForSuccessfulPing() {
108
90
  return new Promise(function (resolve) {
109
91
  return setTimeout(resolve, ms);
110
92
  });
111
-
112
93
  case 12:
113
94
  _context3.next = 1;
114
95
  break;
115
-
116
96
  case 14:
117
97
  case "end":
118
98
  return _context3.stop();
@@ -122,7 +102,6 @@ function _waitForSuccessfulPing() {
122
102
  }));
123
103
  return _waitForSuccessfulPing.apply(this, arguments);
124
104
  }
125
-
126
105
  socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
127
106
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
128
107
  while (1) {
@@ -132,10 +111,8 @@ socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_r
132
111
  console.info('[webpack] Dev server disconnected. Polling for restart...');
133
112
  _context2.next = 4;
134
113
  return waitForSuccessfulPing();
135
-
136
114
  case 4:
137
115
  location.reload();
138
-
139
116
  case 5:
140
117
  case "end":
141
118
  return _context2.stop();
@@ -148,27 +125,28 @@ ErrorOverlay.startReportingRuntimeErrors({
148
125
  hadRuntimeError = true;
149
126
  },
150
127
  filename: '/static/js/bundle.js'
151
- }); // @ts-ignore
128
+ });
152
129
 
130
+ // @ts-ignore
153
131
  if (module.hot && typeof module.hot.dispose === 'function') {
154
132
  // @ts-ignore
155
133
  module.hot.dispose(function () {
156
134
  // TODO: why do we need this?
157
135
  ErrorOverlay.stopReportingRuntimeErrors();
158
136
  });
159
- } // There is a newer version of the code available.
160
-
137
+ }
161
138
 
139
+ // There is a newer version of the code available.
162
140
  function handleAvailableHash(hash) {
163
141
  // Update last known compilation hash.
164
142
  mostRecentCompilationHash = hash;
165
143
  }
166
-
167
144
  function handleSuccess() {
168
145
  var isHotUpdate = !isFirstCompilation;
169
146
  isFirstCompilation = false;
170
- hasCompileErrors = false; // Attempt to apply hot updates or reload.
147
+ hasCompileErrors = false;
171
148
 
149
+ // Attempt to apply hot updates or reload.
172
150
  if (isHotUpdate) {
173
151
  tryApplyUpdates(function onHotUpdateSuccess() {
174
152
  // Only dismiss it when we're sure it's a hot update.
@@ -177,7 +155,6 @@ function handleSuccess() {
177
155
  });
178
156
  }
179
157
  }
180
-
181
158
  function handleWarnings(warnings) {
182
159
  var isHotUpdate = !isFirstCompilation;
183
160
  isFirstCompilation = false;
@@ -185,20 +162,20 @@ function handleWarnings(warnings) {
185
162
  var formatted = formatWebpackMessages({
186
163
  warnings: warnings,
187
164
  errors: []
188
- }); // print warnings
165
+ });
189
166
 
167
+ // print warnings
190
168
  if (typeof console !== 'undefined' && typeof console.warn === 'function') {
191
169
  for (var i = 0; i < formatted.warnings.length; i++) {
192
170
  if (i === 5) {
193
171
  console.warn('There were more warnings in other files.\n' + 'You can find a complete log in the terminal.');
194
172
  break;
195
173
  }
196
-
197
174
  console.warn(stripAnsi(formatted.warnings[i]));
198
175
  }
199
- } // Attempt to apply hot updates or reload.
200
-
176
+ }
201
177
 
178
+ // Attempt to apply hot updates or reload.
202
179
  if (isHotUpdate) {
203
180
  tryApplyUpdates(function onSuccessfulHotUpdate() {
204
181
  // Only dismiss it when we're sure it's a hot update.
@@ -207,97 +184,87 @@ function handleWarnings(warnings) {
207
184
  });
208
185
  }
209
186
  }
210
-
211
187
  function handleErrors(errors) {
212
188
  isFirstCompilation = false;
213
189
  hasCompileErrors = true;
214
190
  var formatted = formatWebpackMessages({
215
191
  warnings: [],
216
192
  errors: errors
217
- }); // Only show the first error.
193
+ });
218
194
 
219
- ErrorOverlay.reportBuildError(formatted.errors[0]); // Also log them to the console.
195
+ // Only show the first error.
196
+ ErrorOverlay.reportBuildError(formatted.errors[0]);
220
197
 
198
+ // Also log them to the console.
221
199
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
222
200
  for (var i = 0; i < formatted.errors.length; i++) {
223
201
  console.error(stripAnsi(formatted.errors[i]));
224
202
  }
225
203
  }
226
204
  }
227
-
228
205
  function tryDismissErrorOverlay() {
229
206
  if (!hasCompileErrors) {
230
207
  ErrorOverlay.dismissBuildError();
231
208
  }
232
- } // Is there a newer version of this code available?
233
-
209
+ }
234
210
 
211
+ // Is there a newer version of this code available?
235
212
  function isUpdateAvailable() {
236
213
  // @ts-ignore
237
214
  return mostRecentCompilationHash !== __webpack_hash__;
238
215
  }
239
-
240
216
  function canApplyUpdates() {
241
217
  // @ts-ignore
242
218
  return module.hot.status() === 'idle';
243
219
  }
244
-
245
220
  function canAcceptErrors() {
246
221
  // NOTE: This var is injected by Webpack's DefinePlugin, and is a boolean instead of string.
247
- var hasReactRefresh = process.env.FAST_REFRESH; // @ts-ignore
222
+ var hasReactRefresh = process.env.FAST_REFRESH;
248
223
 
249
- var status = module.hot.status(); // React refresh can handle hot-reloading over errors.
224
+ // @ts-ignore
225
+ var status = module.hot.status();
226
+ // React refresh can handle hot-reloading over errors.
250
227
  // However, when hot-reload status is abort or fail,
251
228
  // it indicates the current update cannot be applied safely,
252
229
  // and thus we should bail out to a forced reload for consistency.
253
-
254
230
  return hasReactRefresh && ['abort', 'fail'].indexOf(status) === -1;
255
231
  }
256
-
257
232
  function tryApplyUpdates(onHotUpdateSuccess) {
258
233
  // @ts-ignore
259
234
  if (!module.hot) {
260
235
  window.location.reload();
261
236
  return;
262
237
  }
263
-
264
238
  if (!isUpdateAvailable() || !canApplyUpdates()) {
265
239
  return;
266
240
  }
267
-
268
241
  function handleApplyUpdates(err, updatedModules) {
269
- var haveErrors = err || hadRuntimeError; // When there is no error but updatedModules is unavailable,
242
+ var haveErrors = err || hadRuntimeError;
243
+ // When there is no error but updatedModules is unavailable,
270
244
  // it indicates a critical failure in hot-reloading,
271
245
  // e.g. server is not ready to serve new bundle,
272
246
  // and hence we need to do a forced reload.
273
-
274
247
  var needsForcedReload = !err && !updatedModules;
275
-
276
248
  if (haveErrors && !canAcceptErrors() || needsForcedReload) {
277
249
  window.location.reload();
278
250
  }
279
-
280
- if (onHotUpdateSuccess) onHotUpdateSuccess(); // While we were updating, there was a new update! Do it again.
281
-
251
+ if (onHotUpdateSuccess) onHotUpdateSuccess();
252
+ // While we were updating, there was a new update! Do it again.
282
253
  if (isUpdateAvailable()) {
283
254
  tryApplyUpdates();
284
255
  }
285
- } // @ts-ignore
286
-
256
+ }
287
257
 
288
- module.hot.check(
289
- /* autoApply */
290
- true).then(function (updatedModules) {
258
+ // @ts-ignore
259
+ module.hot.check( /* autoApply */true).then(function (updatedModules) {
291
260
  handleApplyUpdates(null, updatedModules);
292
261
  }).catch(function (err) {
293
262
  handleApplyUpdates(err, null);
294
263
  });
295
264
  }
296
-
297
265
  function handleMessage(_x2) {
298
266
  return _handleMessage.apply(this, arguments);
299
267
  }
300
-
301
268
  function _handleMessage() {
302
269
  _handleMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
303
270
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -307,23 +274,18 @@ function _handleMessage() {
307
274
  _context4.t0 = payload.type;
308
275
  _context4.next = _context4.t0 === MESSAGE_TYPE.hash ? 3 : _context4.t0 === MESSAGE_TYPE.stillOk ? 5 : _context4.t0 === MESSAGE_TYPE.ok ? 5 : _context4.t0 === MESSAGE_TYPE.errors ? 7 : _context4.t0 === MESSAGE_TYPE.warnings ? 9 : 11;
309
276
  break;
310
-
311
277
  case 3:
312
278
  handleAvailableHash(payload.data);
313
279
  return _context4.abrupt("break", 11);
314
-
315
280
  case 5:
316
281
  handleSuccess();
317
282
  return _context4.abrupt("break", 11);
318
-
319
283
  case 7:
320
284
  handleErrors(payload.data);
321
285
  return _context4.abrupt("break", 11);
322
-
323
286
  case 9:
324
287
  handleWarnings(payload.data);
325
288
  return _context4.abrupt("break", 11);
326
-
327
289
  case 11:
328
290
  case "end":
329
291
  return _context4.stop();
@@ -0,0 +1 @@
1
+ module.exports = require('./').BasicEvaluatedExpression;
@@ -0,0 +1 @@
1
+ module.exports = require('./').ExternalsPlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').FetchCompileAsyncWasmPlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').FetchCompileWasmPlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').LimitChunkCountPlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').NodeTargetPlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').NodeTemplatePlugin;
@@ -0,0 +1 @@
1
+ module.exports = require('./').StringXor;
@@ -0,0 +1 @@
1
+ module.exports = require('./').WebWorkerTemplatePlugin;
@@ -13,5 +13,14 @@
13
13
  "webpack/lib/rules/BasicMatcherRulePlugin",
14
14
  "webpack/lib/rules/ObjectMatcherRulePlugin",
15
15
  "webpack/lib/rules/RuleSetCompiler",
16
- "webpack/lib/rules/UseEffectRulePlugin"
16
+ "webpack/lib/rules/UseEffectRulePlugin",
17
+ "webpack/lib/node/NodeTargetPlugin",
18
+ "webpack/lib/webworker/WebWorkerTemplatePlugin",
19
+ "webpack/lib/ExternalsPlugin",
20
+ "webpack/lib/javascript/BasicEvaluatedExpression",
21
+ "webpack/lib/node/NodeTemplatePlugin",
22
+ "webpack/lib/optimize/LimitChunkCountPlugin",
23
+ "webpack/lib/web/FetchCompileAsyncWasmPlugin",
24
+ "webpack/lib/web/FetchCompileWasmPlugin",
25
+ "webpack/lib/util/StringXor"
17
26
  ]