@umijs/bundler-webpack 4.0.0-beta.8 → 4.0.0-canary-20240513.3
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.
- package/client/client/client.js +255 -167
- package/client/constants.d.ts +15 -0
- package/client/constants.js +30 -12
- package/client/utils/formatWebpackMessages.d.ts +12 -0
- package/client/utils/formatWebpackMessages.js +87 -86
- package/compiled/autoprefixer/browserslist/index.d.ts +33 -7
- package/compiled/autoprefixer/index.js +3 -3
- package/compiled/autoprefixer/package.json +1 -1
- package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
- package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
- package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
- package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
- package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
- package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
- package/compiled/autoprefixer/postcss/lib/node.d.ts +38 -4
- package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
- package/compiled/autoprefixer/postcss/lib/processor.d.ts +6 -5
- package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
- package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
- package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
- package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
- package/compiled/babel-loader/index.js +8 -2
- package/compiled/babel-loader/package.json +1 -1
- package/compiled/copy-webpack-plugin/939.index.js +1171 -0
- package/compiled/copy-webpack-plugin/index.js +16 -10
- package/compiled/copy-webpack-plugin/package.json +1 -1
- package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
- package/compiled/css-minimizer-webpack-plugin/minify.js +23 -22
- package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
- package/compiled/css-minimizer-webpack-plugin/utils.js +305 -54
- package/compiled/cssnano/index.js +12 -11
- package/compiled/cssnano/package.json +1 -1
- package/compiled/express.d.ts +2 -0
- package/compiled/file-loader/index.js +3 -0
- package/compiled/file-loader/package.json +1 -0
- package/compiled/less-loader/index.js +1 -1
- package/compiled/less-loader/package.json +1 -1
- package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -46
- package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +10 -6
- package/compiled/mini-css-extract-plugin/index.js +10669 -10348
- package/compiled/mini-css-extract-plugin/loader.js +159 -100
- package/compiled/mini-css-extract-plugin/package.json +1 -1
- package/compiled/mini-css-extract-plugin/utils.js +88 -44
- package/compiled/postcss-loader/index.js +1 -1
- package/compiled/postcss-loader/package.json +1 -1
- package/compiled/sass-loader/index.js +1 -1
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/sass-loader/sass.default.dart.js +4 -0
- package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
- package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
- package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
- package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
- package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
- package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
- package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
- package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
- package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
- package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
- package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
- package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
- package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
- package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
- package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
- package/compiled/schema-utils/declarations/validate.d.ts +4 -4
- package/compiled/schema-utils/index.js +8 -2
- package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
- package/compiled/style-loader/index.js +1 -1
- package/compiled/stylus-loader/LICENSE +20 -0
- package/compiled/stylus-loader/index.js +44 -0
- package/compiled/stylus-loader/package.json +1 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
- package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
- package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser/index.js +1 -1
- package/compiled/terser/package.json +1 -1
- package/compiled/terser/tools/terser.d.ts +6 -3
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
- package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
- package/compiled/terser-webpack-plugin/index.js +1390 -3693
- package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
- package/compiled/terser-webpack-plugin/minify.js +10 -3
- package/compiled/terser-webpack-plugin/package.json +1 -1
- package/compiled/terser-webpack-plugin/types/index.d.ts +186 -152
- package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
- package/compiled/terser-webpack-plugin/types/utils.d.ts +20 -24
- package/compiled/terser-webpack-plugin/utils.js +153 -34
- package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
- package/compiled/webpack/BasicEvaluatedExpression.js +1 -0
- package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
- package/compiled/webpack/ExternalsPlugin.js +1 -0
- package/compiled/webpack/FetchCompileAsyncWasmPlugin.js +1 -0
- package/compiled/webpack/FetchCompileWasmPlugin.js +1 -0
- package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
- package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
- package/compiled/webpack/LimitChunkCountPlugin.js +1 -0
- package/compiled/webpack/NodeTargetPlugin.js +1 -0
- package/compiled/webpack/NodeTemplatePlugin.js +1 -0
- package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
- package/compiled/webpack/RuleSetCompiler.js +1 -0
- package/compiled/webpack/StringXor.js +1 -0
- package/compiled/webpack/UseEffectRulePlugin.js +1 -0
- package/compiled/webpack/WebWorkerTemplatePlugin.js +1 -0
- package/compiled/webpack/deepImports.json +15 -1
- package/compiled/webpack/index.js +26404 -10329
- package/compiled/webpack/json-schema/index.d.ts +8 -1
- package/compiled/webpack/lazy-compilation-node.js +10 -0
- package/compiled/webpack/lazy-compilation-web.js +9 -0
- package/compiled/webpack/types.d.ts +823 -287
- package/compiled/webpack-5-chain/index.js +1 -1
- package/compiled/webpack-5-chain/package.json +1 -1
- package/compiled/webpack-5-chain/types/index.d.ts +76 -20
- package/compiled/webpack-bundle-analyzer/index.js +7 -6
- package/compiled/webpack-bundle-analyzer/package.json +1 -1
- package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
- package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
- package/compiled/webpack-dev-middleware/index.js +12 -5
- package/compiled/webpack-dev-middleware/package.json +1 -1
- package/compiled/{tapable → webpack-manifest-plugin}/LICENSE +2 -2
- package/compiled/webpack-manifest-plugin/index.js +1 -0
- package/compiled/webpack-manifest-plugin/package.json +1 -0
- package/compiled/webpack-sources/index.js +1 -1
- package/compiled/{express → webpackbar}/LICENSE +1 -5
- package/compiled/webpackbar/dist/index.d.ts +121 -0
- package/compiled/webpackbar/index.js +7 -0
- package/compiled/webpackbar/package.json +1 -0
- package/compiled/ws/LICENSE +13 -12
- package/compiled/ws/index.d.ts +74 -35
- package/compiled/ws/index.js +1 -1
- package/compiled/ws/package.json +1 -1
- package/dist/build.d.ts +8 -3
- package/dist/build.js +147 -68
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +84 -81
- package/dist/config/_sampleFeature.js +33 -20
- package/dist/config/assetRules.js +46 -55
- package/dist/config/bundleAnalyzerPlugin.js +41 -28
- package/dist/config/compressPlugin.js +125 -74
- package/dist/config/config.d.ts +11 -2
- package/dist/config/config.js +235 -172
- package/dist/config/copyPlugin.js +61 -47
- package/dist/config/cssRules.js +162 -95
- package/dist/config/definePlugin.d.ts +2 -0
- package/dist/config/definePlugin.js +59 -39
- package/dist/config/detectCssModulesInDependence.d.ts +10 -0
- package/dist/config/detectCssModulesInDependence.js +151 -0
- package/dist/config/detectDeadCode.d.ts +12 -0
- package/dist/config/detectDeadCode.js +191 -0
- package/dist/config/detectDeadCodePlugin.d.ts +9 -0
- package/dist/config/detectDeadCodePlugin.js +82 -0
- package/dist/config/fastRefreshPlugin.js +46 -31
- package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
- package/dist/config/forkTSCheckerPlugin.js +49 -0
- package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
- package/dist/config/harmonyLinkingErrorPlugin.js +53 -0
- package/dist/config/ignorePlugin.js +38 -25
- package/dist/config/javaScriptRules.d.ts +2 -0
- package/dist/config/javaScriptRules.js +186 -150
- package/dist/config/manifestPlugin.d.ts +11 -0
- package/dist/config/manifestPlugin.js +40 -0
- package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
- package/dist/config/miniCSSExtractPlugin.js +52 -31
- package/dist/config/nodePolyfill.js +49 -32
- package/dist/config/nodePrefixPlugin.d.ts +11 -0
- package/dist/config/nodePrefixPlugin.js +38 -0
- package/dist/config/progressPlugin.js +50 -24
- package/dist/config/purgecssWebpackPlugin.js +41 -30
- package/dist/config/speedMeasureWebpackPlugin.js +56 -31
- package/dist/config/ssrPlugin.d.ts +11 -0
- package/dist/config/ssrPlugin.js +98 -0
- package/dist/config/svgRules.d.ts +1 -0
- package/dist/config/svgRules.js +68 -54
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +59 -15
- package/dist/dev.d.ts +23 -3
- package/dist/dev.js +198 -81
- package/dist/index.d.ts +6 -2
- package/dist/index.js +31 -15
- package/dist/loader/svgr.d.ts +4 -0
- package/dist/loader/svgr.js +84 -0
- package/dist/loader/swc.d.ts +4 -0
- package/dist/loader/swc.js +149 -0
- package/dist/parcelCSS.d.ts +2 -0
- package/dist/parcelCSS.js +39 -0
- package/dist/plugins/EsbuildMinifyFix.d.ts +8 -0
- package/dist/plugins/EsbuildMinifyFix.js +136 -0
- package/dist/plugins/ProgressPlugin.js +68 -43
- package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
- package/dist/plugins/RuntimePublicPathPlugin.js +45 -0
- package/dist/plugins/_SamplePlugin.d.ts +1 -1
- package/dist/plugins/_SamplePlugin.js +37 -14
- package/dist/requireHook.js +44 -27
- package/dist/schema.d.ts +4 -3
- package/dist/schema.js +175 -69
- package/dist/server/server.d.ts +4 -3
- package/dist/server/server.js +219 -154
- package/dist/server/ws.d.ts +8 -3
- package/dist/server/ws.js +72 -38
- package/dist/swcPlugins/autoCSSModules.d.ts +11 -2
- package/dist/swcPlugins/autoCSSModules.js +60 -32
- package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
- package/dist/swcPlugins/changeImportFromString.js +32 -0
- package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
- package/dist/swcPlugins/lockCoreJS.js +56 -0
- package/dist/types.d.ts +53 -9
- package/dist/types.js +61 -29
- package/dist/utils/browsersList.js +31 -8
- package/dist/utils/depMatch.js +65 -39
- package/dist/utils/formatWebpackMessages.js +119 -91
- package/dist/utils/getEsBuildTarget.d.ts +7 -0
- package/dist/utils/getEsBuildTarget.js +46 -0
- package/dist/utils/pkgUpContainsName.d.ts +1 -0
- package/dist/utils/pkgUpContainsName.js +50 -0
- package/package.json +89 -81
- package/compiled/@svgr/webpack/.svgo.yml +0 -75
- package/compiled/@svgr/webpack/LICENSE +0 -7
- package/compiled/@svgr/webpack/index.js +0 -343
- package/compiled/@svgr/webpack/package.json +0 -1
- package/compiled/css-loader/api.js +0 -102
- package/compiled/css-loader/getUrl.js +0 -29
- package/compiled/css-loader/index.js +0 -2
- package/compiled/css-loader/noSourceMaps.js +0 -5
- package/compiled/css-loader/package.json +0 -1
- package/compiled/css-loader/sourceMaps.js +0 -22
- package/compiled/express/body-parser/index.d.ts +0 -104
- package/compiled/express/connect/index.d.ts +0 -93
- package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
- package/compiled/express/index.d.ts +0 -133
- package/compiled/express/index.js +0 -338
- package/compiled/express/mime/index.d.ts +0 -35
- package/compiled/express/package.json +0 -1
- package/compiled/express/qs/index.d.ts +0 -62
- package/compiled/express/range-parser/index.d.ts +0 -35
- package/compiled/express/serve-static/index.d.ts +0 -108
- package/compiled/http-proxy-middleware/LICENSE +0 -22
- package/compiled/http-proxy-middleware/dist/index.d.ts +0 -4
- package/compiled/http-proxy-middleware/dist/types.d.ts +0 -54
- package/compiled/http-proxy-middleware/http-proxy/index.d.ts +0 -226
- package/compiled/http-proxy-middleware/index.js +0 -66
- package/compiled/http-proxy-middleware/package.json +0 -1
- package/compiled/less/index.js +0 -31
- package/compiled/less/package.json +0 -1
- package/compiled/react-refresh/index.js +0 -19
- package/compiled/swc-loader/LICENSE +0 -25
- package/compiled/swc-loader/index.js +0 -1
- package/compiled/swc-loader/package.json +0 -1
- package/compiled/tapable/index.js +0 -1
- package/compiled/tapable/package.json +0 -1
- package/compiled/tapable/tapable.d.ts +0 -116
- package/dist/build.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js +0 -239
- package/dist/config/_sampleFeature.d.ts.map +0 -1
- package/dist/config/assetRules.d.ts.map +0 -1
- package/dist/config/bundleAnalyzerPlugin.d.ts.map +0 -1
- package/dist/config/compressPlugin.d.ts.map +0 -1
- package/dist/config/config.d.ts.map +0 -1
- package/dist/config/copyPlugin.d.ts.map +0 -1
- package/dist/config/cssRules.d.ts.map +0 -1
- package/dist/config/definePlugin.d.ts.map +0 -1
- package/dist/config/fastRefreshPlugin.d.ts.map +0 -1
- package/dist/config/ignorePlugin.d.ts.map +0 -1
- package/dist/config/javaScriptRules.d.ts.map +0 -1
- package/dist/config/miniCSSExtractPlugin.d.ts.map +0 -1
- package/dist/config/nodePolyfill.d.ts.map +0 -1
- package/dist/config/progressPlugin.d.ts.map +0 -1
- package/dist/config/purgecssWebpackPlugin.d.ts.map +0 -1
- package/dist/config/speedMeasureWebpackPlugin.d.ts.map +0 -1
- package/dist/config/svgRules.d.ts.map +0 -1
- package/dist/constants.d.ts.map +0 -1
- package/dist/dev.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
- package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts.map +0 -1
- package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
- package/dist/plugins/ProgressPlugin.d.ts.map +0 -1
- package/dist/plugins/_SamplePlugin.d.ts.map +0 -1
- package/dist/requireHook.d.ts.map +0 -1
- package/dist/schema.d.ts.map +0 -1
- package/dist/server/server.d.ts.map +0 -1
- package/dist/server/ws.d.ts.map +0 -1
- package/dist/swcPlugins/autoCSSModules.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/browsersList.d.ts.map +0 -1
- package/dist/utils/depMatch.d.ts.map +0 -1
- package/dist/utils/formatWebpackMessages.d.ts.map +0 -1
- /package/{dist → client}/client/client.d.ts +0 -0
- /package/compiled/{css-loader → file-loader}/LICENSE +0 -0
package/client/client/client.js
CHANGED
|
@@ -1,202 +1,290 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
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); } }
|
|
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); }); }; }
|
|
1
5
|
import stripAnsi from '@umijs/utils/compiled/strip-ansi';
|
|
2
6
|
// @ts-ignore
|
|
3
7
|
import * as ErrorOverlay from 'react-error-overlay';
|
|
4
|
-
import { MESSAGE_TYPE } from
|
|
5
|
-
import { formatWebpackMessages } from
|
|
8
|
+
import { MESSAGE_TYPE } from "../constants";
|
|
9
|
+
import { formatWebpackMessages } from "../utils/formatWebpackMessages";
|
|
6
10
|
console.log('[webpack] connecting...');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
function getHost() {
|
|
12
|
+
if (process.env.SOCKET_SERVER) {
|
|
13
|
+
return new URL(process.env.SOCKET_SERVER);
|
|
14
|
+
}
|
|
15
|
+
return location;
|
|
16
|
+
}
|
|
17
|
+
function getSocketUrl() {
|
|
18
|
+
var h = getHost();
|
|
19
|
+
var host = h.host;
|
|
20
|
+
var isHttps = h.protocol === 'https:';
|
|
21
|
+
return "".concat(isHttps ? 'wss' : 'ws', "://").concat(host);
|
|
22
|
+
}
|
|
23
|
+
function getPingUrl() {
|
|
24
|
+
var h = getHost();
|
|
25
|
+
return "".concat(h.protocol, "//").concat(h.host, "/__umi_ping");
|
|
26
|
+
}
|
|
27
|
+
var pingTimer = null;
|
|
28
|
+
var isFirstCompilation = true;
|
|
29
|
+
var mostRecentCompilationHash = null;
|
|
30
|
+
var hasCompileErrors = false;
|
|
31
|
+
var hadRuntimeError = false;
|
|
32
|
+
var pingUrl = getPingUrl();
|
|
33
|
+
var socket = new WebSocket(getSocketUrl(), 'webpack-hmr');
|
|
34
|
+
socket.addEventListener('message', /*#__PURE__*/function () {
|
|
35
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
36
|
+
var data;
|
|
37
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
38
|
+
while (1) switch (_context.prev = _context.next) {
|
|
39
|
+
case 0:
|
|
40
|
+
data = _ref.data;
|
|
41
|
+
data = JSON.parse(data);
|
|
42
|
+
if (data.type === 'connected') {
|
|
43
|
+
console.log("[webpack] connected.");
|
|
44
|
+
// proxy(nginx, docker) hmr ws maybe caused timeout,
|
|
45
|
+
// so send ping package let ws keep alive.
|
|
46
|
+
pingTimer = window.setInterval(function () {
|
|
47
|
+
return socket.send('ping');
|
|
48
|
+
}, 30000);
|
|
49
|
+
} else {
|
|
50
|
+
handleMessage(data).catch(console.error);
|
|
51
|
+
}
|
|
52
|
+
case 3:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee);
|
|
57
|
+
}));
|
|
58
|
+
return function (_x) {
|
|
59
|
+
return _ref2.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}());
|
|
62
|
+
function waitForSuccessfulPing() {
|
|
63
|
+
return _waitForSuccessfulPing.apply(this, arguments);
|
|
64
|
+
}
|
|
65
|
+
function _waitForSuccessfulPing() {
|
|
66
|
+
_waitForSuccessfulPing = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
67
|
+
var ms,
|
|
68
|
+
_args3 = arguments;
|
|
69
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
70
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
ms = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : 1000;
|
|
73
|
+
case 1:
|
|
74
|
+
if (!true) {
|
|
75
|
+
_context3.next = 14;
|
|
32
76
|
break;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
}
|
|
78
|
+
_context3.prev = 2;
|
|
79
|
+
_context3.next = 5;
|
|
80
|
+
return fetch(pingUrl);
|
|
81
|
+
case 5:
|
|
82
|
+
return _context3.abrupt("break", 14);
|
|
83
|
+
case 8:
|
|
84
|
+
_context3.prev = 8;
|
|
85
|
+
_context3.t0 = _context3["catch"](2);
|
|
86
|
+
_context3.next = 12;
|
|
87
|
+
return new Promise(function (resolve) {
|
|
88
|
+
return setTimeout(resolve, ms);
|
|
89
|
+
});
|
|
90
|
+
case 12:
|
|
91
|
+
_context3.next = 1;
|
|
92
|
+
break;
|
|
93
|
+
case 14:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context3.stop();
|
|
96
|
+
}
|
|
97
|
+
}, _callee3, null, [[2, 8]]);
|
|
98
|
+
}));
|
|
99
|
+
return _waitForSuccessfulPing.apply(this, arguments);
|
|
38
100
|
}
|
|
39
|
-
socket.addEventListener('close',
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
101
|
+
socket.addEventListener('close', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
102
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
103
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
104
|
+
case 0:
|
|
105
|
+
if (pingTimer) clearInterval(pingTimer);
|
|
106
|
+
console.info('[webpack] Dev server disconnected. Polling for restart...');
|
|
107
|
+
_context2.next = 4;
|
|
108
|
+
return waitForSuccessfulPing();
|
|
109
|
+
case 4:
|
|
110
|
+
location.reload();
|
|
111
|
+
case 5:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context2.stop();
|
|
114
|
+
}
|
|
115
|
+
}, _callee2);
|
|
116
|
+
})));
|
|
117
|
+
var enableErrorOverlay = process.env.ERROR_OVERLAY !== 'none';
|
|
118
|
+
enableErrorOverlay && ErrorOverlay.startReportingRuntimeErrors({
|
|
119
|
+
onError: function onError() {
|
|
120
|
+
hadRuntimeError = true;
|
|
121
|
+
},
|
|
122
|
+
filename: '/static/js/bundle.js'
|
|
51
123
|
});
|
|
124
|
+
|
|
52
125
|
// @ts-ignore
|
|
53
126
|
if (module.hot && typeof module.hot.dispose === 'function') {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
module.hot.dispose(function () {
|
|
129
|
+
// TODO: why do we need this?
|
|
130
|
+
enableErrorOverlay && ErrorOverlay.stopReportingRuntimeErrors();
|
|
131
|
+
});
|
|
59
132
|
}
|
|
133
|
+
|
|
60
134
|
// There is a newer version of the code available.
|
|
61
135
|
function handleAvailableHash(hash) {
|
|
62
|
-
|
|
63
|
-
|
|
136
|
+
// Update last known compilation hash.
|
|
137
|
+
mostRecentCompilationHash = hash;
|
|
64
138
|
}
|
|
65
139
|
function handleSuccess() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
140
|
+
var isHotUpdate = !isFirstCompilation;
|
|
141
|
+
isFirstCompilation = false;
|
|
142
|
+
hasCompileErrors = false;
|
|
143
|
+
|
|
144
|
+
// Attempt to apply hot updates or reload.
|
|
145
|
+
if (isHotUpdate) {
|
|
146
|
+
tryApplyUpdates(function onHotUpdateSuccess() {
|
|
147
|
+
// Only dismiss it when we're sure it's a hot update.
|
|
148
|
+
// Otherwise, it would flicker right before the reload.
|
|
149
|
+
tryDismissErrorOverlay();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
77
152
|
}
|
|
78
153
|
function handleWarnings(warnings) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// Attempt to apply hot updates or reload.
|
|
98
|
-
if (isHotUpdate) {
|
|
99
|
-
tryApplyUpdates(function onSuccessfulHotUpdate() {
|
|
100
|
-
// Only dismiss it when we're sure it's a hot update.
|
|
101
|
-
// Otherwise it would flicker right before the reload.
|
|
102
|
-
tryDismissErrorOverlay();
|
|
103
|
-
});
|
|
154
|
+
var isHotUpdate = !isFirstCompilation;
|
|
155
|
+
isFirstCompilation = false;
|
|
156
|
+
hasCompileErrors = false;
|
|
157
|
+
var formatted = formatWebpackMessages({
|
|
158
|
+
warnings: warnings,
|
|
159
|
+
errors: []
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// print warnings
|
|
163
|
+
if (typeof console !== 'undefined' && typeof console.warn === 'function') {
|
|
164
|
+
for (var i = 0; i < formatted.warnings.length; i++) {
|
|
165
|
+
if (i === 5) {
|
|
166
|
+
console.warn('There were more warnings in other files.\n' + 'You can find a complete log in the terminal.');
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
console.warn(stripAnsi(formatted.warnings[i]));
|
|
104
170
|
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Attempt to apply hot updates or reload.
|
|
174
|
+
if (isHotUpdate) {
|
|
175
|
+
tryApplyUpdates(function onSuccessfulHotUpdate() {
|
|
176
|
+
// Only dismiss it when we're sure it's a hot update.
|
|
177
|
+
// Otherwise, it would flicker right before the reload.
|
|
178
|
+
tryDismissErrorOverlay();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
105
181
|
}
|
|
106
182
|
function handleErrors(errors) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
183
|
+
isFirstCompilation = false;
|
|
184
|
+
hasCompileErrors = true;
|
|
185
|
+
var formatted = formatWebpackMessages({
|
|
186
|
+
warnings: [],
|
|
187
|
+
errors: errors
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Only show the first error.
|
|
191
|
+
enableErrorOverlay && ErrorOverlay.reportBuildError(formatted.errors[0]);
|
|
192
|
+
|
|
193
|
+
// Also log them to the console.
|
|
194
|
+
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
195
|
+
for (var i = 0; i < formatted.errors.length; i++) {
|
|
196
|
+
console.error(stripAnsi(formatted.errors[i]));
|
|
120
197
|
}
|
|
198
|
+
}
|
|
121
199
|
}
|
|
122
200
|
function tryDismissErrorOverlay() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
201
|
+
if (!hasCompileErrors) {
|
|
202
|
+
enableErrorOverlay && ErrorOverlay.dismissBuildError();
|
|
203
|
+
}
|
|
126
204
|
}
|
|
205
|
+
|
|
127
206
|
// Is there a newer version of this code available?
|
|
128
207
|
function isUpdateAvailable() {
|
|
129
|
-
|
|
130
|
-
|
|
208
|
+
// @ts-ignore
|
|
209
|
+
return mostRecentCompilationHash !== __webpack_hash__;
|
|
131
210
|
}
|
|
132
211
|
function canApplyUpdates() {
|
|
133
|
-
|
|
134
|
-
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
return module.hot.status() === 'idle';
|
|
135
214
|
}
|
|
136
215
|
function canAcceptErrors() {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
216
|
+
// NOTE: This var is injected by Webpack's DefinePlugin, and is a boolean instead of string.
|
|
217
|
+
var hasReactRefresh = process.env.FAST_REFRESH;
|
|
218
|
+
|
|
219
|
+
// @ts-ignore
|
|
220
|
+
var status = module.hot.status();
|
|
221
|
+
// React refresh can handle hot-reloading over errors.
|
|
222
|
+
// However, when hot-reload status is abort or fail,
|
|
223
|
+
// it indicates the current update cannot be applied safely,
|
|
224
|
+
// and thus we should bail out to a forced reload for consistency.
|
|
225
|
+
return hasReactRefresh && ['abort', 'fail'].indexOf(status) === -1;
|
|
146
226
|
}
|
|
147
227
|
function tryApplyUpdates(onHotUpdateSuccess) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
228
|
+
// @ts-ignore
|
|
229
|
+
if (!module.hot) {
|
|
230
|
+
window.location.reload();
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (!isUpdateAvailable() || !canApplyUpdates()) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
function handleApplyUpdates(err, updatedModules) {
|
|
237
|
+
var haveErrors = err || hadRuntimeError;
|
|
238
|
+
// When there is no error but updatedModules is unavailable,
|
|
239
|
+
// it indicates a critical failure in hot-reloading,
|
|
240
|
+
// e.g. server is not ready to serve new bundle,
|
|
241
|
+
// and hence we need to do a forced reload.
|
|
242
|
+
var needsForcedReload = !err && !updatedModules;
|
|
243
|
+
if (haveErrors && !canAcceptErrors() || needsForcedReload) {
|
|
244
|
+
window.location.reload();
|
|
155
245
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
// e.g. server is not ready to serve new bundle,
|
|
161
|
-
// and hence we need to do a forced reload.
|
|
162
|
-
const needsForcedReload = !err && !updatedModules;
|
|
163
|
-
if ((haveErrors && !canAcceptErrors()) || needsForcedReload) {
|
|
164
|
-
window.location.reload();
|
|
165
|
-
}
|
|
166
|
-
if (onHotUpdateSuccess)
|
|
167
|
-
onHotUpdateSuccess();
|
|
168
|
-
// While we were updating, there was a new update! Do it again.
|
|
169
|
-
if (isUpdateAvailable()) {
|
|
170
|
-
tryApplyUpdates();
|
|
171
|
-
}
|
|
246
|
+
if (onHotUpdateSuccess) onHotUpdateSuccess();
|
|
247
|
+
// While we were updating, there was a new update! Do it again.
|
|
248
|
+
if (isUpdateAvailable()) {
|
|
249
|
+
tryApplyUpdates();
|
|
172
250
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// @ts-ignore
|
|
254
|
+
module.hot.check( /* autoApply */true).then(function (updatedModules) {
|
|
255
|
+
handleApplyUpdates(null, updatedModules);
|
|
256
|
+
}).catch(function (err) {
|
|
257
|
+
handleApplyUpdates(err, null);
|
|
258
|
+
});
|
|
182
259
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
switch (payload.type) {
|
|
186
|
-
case MESSAGE_TYPE.hash:
|
|
187
|
-
handleAvailableHash(payload.data);
|
|
188
|
-
break;
|
|
189
|
-
case MESSAGE_TYPE.stillOk:
|
|
190
|
-
case MESSAGE_TYPE.ok:
|
|
191
|
-
handleSuccess();
|
|
192
|
-
break;
|
|
193
|
-
case MESSAGE_TYPE.errors:
|
|
194
|
-
handleErrors(payload.data);
|
|
195
|
-
break;
|
|
196
|
-
case MESSAGE_TYPE.warnings:
|
|
197
|
-
handleWarnings(payload.data);
|
|
198
|
-
break;
|
|
199
|
-
default:
|
|
200
|
-
// Do nothing
|
|
201
|
-
}
|
|
260
|
+
function handleMessage(_x2) {
|
|
261
|
+
return _handleMessage.apply(this, arguments);
|
|
202
262
|
}
|
|
263
|
+
function _handleMessage() {
|
|
264
|
+
_handleMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
|
|
265
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
266
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
267
|
+
case 0:
|
|
268
|
+
_context4.t0 = payload.type;
|
|
269
|
+
_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;
|
|
270
|
+
break;
|
|
271
|
+
case 3:
|
|
272
|
+
handleAvailableHash(payload.data);
|
|
273
|
+
return _context4.abrupt("break", 11);
|
|
274
|
+
case 5:
|
|
275
|
+
handleSuccess();
|
|
276
|
+
return _context4.abrupt("break", 11);
|
|
277
|
+
case 7:
|
|
278
|
+
handleErrors(payload.data);
|
|
279
|
+
return _context4.abrupt("break", 11);
|
|
280
|
+
case 9:
|
|
281
|
+
handleWarnings(payload.data);
|
|
282
|
+
return _context4.abrupt("break", 11);
|
|
283
|
+
case 11:
|
|
284
|
+
case "end":
|
|
285
|
+
return _context4.stop();
|
|
286
|
+
}
|
|
287
|
+
}, _callee4);
|
|
288
|
+
}));
|
|
289
|
+
return _handleMessage.apply(this, arguments);
|
|
290
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DEFAULT_DEVTOOL = "cheap-module-source-map";
|
|
2
|
+
export declare const DEFAULT_OUTPUT_PATH = "dist";
|
|
3
|
+
export declare const MFSU_NAME = "MFSU";
|
|
4
|
+
export declare enum MESSAGE_TYPE {
|
|
5
|
+
ok = "ok",
|
|
6
|
+
warnings = "warnings",
|
|
7
|
+
errors = "errors",
|
|
8
|
+
hash = "hash",
|
|
9
|
+
stillOk = "still-ok",
|
|
10
|
+
invalid = "invalid"
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_BROWSER_TARGETS: {
|
|
13
|
+
chrome: number;
|
|
14
|
+
};
|
|
15
|
+
export declare const DEFAULT_ESBUILD_TARGET_KEYS: string[];
|
package/client/constants.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
var DEFAULT_DEVTOOL = "cheap-module-source-map";
|
|
3
|
+
var DEFAULT_OUTPUT_PATH = "dist";
|
|
4
|
+
var MFSU_NAME = "MFSU";
|
|
5
|
+
var MESSAGE_TYPE = /* @__PURE__ */ ((MESSAGE_TYPE2) => {
|
|
6
|
+
MESSAGE_TYPE2["ok"] = "ok";
|
|
7
|
+
MESSAGE_TYPE2["warnings"] = "warnings";
|
|
8
|
+
MESSAGE_TYPE2["errors"] = "errors";
|
|
9
|
+
MESSAGE_TYPE2["hash"] = "hash";
|
|
10
|
+
MESSAGE_TYPE2["stillOk"] = "still-ok";
|
|
11
|
+
MESSAGE_TYPE2["invalid"] = "invalid";
|
|
12
|
+
return MESSAGE_TYPE2;
|
|
13
|
+
})(MESSAGE_TYPE || {});
|
|
14
|
+
var DEFAULT_BROWSER_TARGETS = {
|
|
15
|
+
chrome: 80
|
|
16
|
+
};
|
|
17
|
+
var DEFAULT_ESBUILD_TARGET_KEYS = [
|
|
18
|
+
"chrome",
|
|
19
|
+
"firefox",
|
|
20
|
+
"edge",
|
|
21
|
+
"safari"
|
|
22
|
+
];
|
|
23
|
+
export {
|
|
24
|
+
DEFAULT_BROWSER_TARGETS,
|
|
25
|
+
DEFAULT_DEVTOOL,
|
|
26
|
+
DEFAULT_ESBUILD_TARGET_KEYS,
|
|
27
|
+
DEFAULT_OUTPUT_PATH,
|
|
28
|
+
MESSAGE_TYPE,
|
|
29
|
+
MFSU_NAME
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function formatMessage(message: string | {
|
|
2
|
+
message: string;
|
|
3
|
+
} | {
|
|
4
|
+
message: string;
|
|
5
|
+
}[]): string;
|
|
6
|
+
export declare function formatWebpackMessages(json: {
|
|
7
|
+
errors: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}): {
|
|
10
|
+
errors: string[];
|
|
11
|
+
warnings: string[];
|
|
12
|
+
};
|