@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.
Files changed (297) hide show
  1. package/client/client/client.js +255 -167
  2. package/client/constants.d.ts +15 -0
  3. package/client/constants.js +30 -12
  4. package/client/utils/formatWebpackMessages.d.ts +12 -0
  5. package/client/utils/formatWebpackMessages.js +87 -86
  6. package/compiled/autoprefixer/browserslist/index.d.ts +33 -7
  7. package/compiled/autoprefixer/index.js +3 -3
  8. package/compiled/autoprefixer/package.json +1 -1
  9. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +1 -1
  10. package/compiled/autoprefixer/postcss/lib/comment.d.ts +1 -1
  11. package/compiled/autoprefixer/postcss/lib/container.d.ts +2 -2
  12. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +55 -8
  13. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +2 -2
  14. package/compiled/autoprefixer/postcss/lib/input.d.ts +26 -6
  15. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +11 -10
  16. package/compiled/autoprefixer/postcss/lib/no-work-result.d.ts +37 -0
  17. package/compiled/autoprefixer/postcss/lib/node.d.ts +38 -4
  18. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +31 -30
  19. package/compiled/autoprefixer/postcss/lib/processor.d.ts +6 -5
  20. package/compiled/autoprefixer/postcss/lib/result.d.ts +3 -2
  21. package/compiled/autoprefixer/postcss/lib/rule.d.ts +1 -1
  22. package/compiled/autoprefixer/postcss/lib/warning.d.ts +37 -3
  23. package/compiled/autoprefixer/source-map-js/source-map.d.ts +99 -82
  24. package/compiled/babel-loader/index.js +8 -2
  25. package/compiled/babel-loader/package.json +1 -1
  26. package/compiled/copy-webpack-plugin/939.index.js +1171 -0
  27. package/compiled/copy-webpack-plugin/index.js +16 -10
  28. package/compiled/copy-webpack-plugin/package.json +1 -1
  29. package/compiled/css-minimizer-webpack-plugin/index.js +8 -2
  30. package/compiled/css-minimizer-webpack-plugin/minify.js +23 -22
  31. package/compiled/css-minimizer-webpack-plugin/package.json +1 -1
  32. package/compiled/css-minimizer-webpack-plugin/utils.js +305 -54
  33. package/compiled/cssnano/index.js +12 -11
  34. package/compiled/cssnano/package.json +1 -1
  35. package/compiled/express.d.ts +2 -0
  36. package/compiled/file-loader/index.js +3 -0
  37. package/compiled/file-loader/package.json +1 -0
  38. package/compiled/less-loader/index.js +1 -1
  39. package/compiled/less-loader/package.json +1 -1
  40. package/compiled/mini-css-extract-plugin/hmr/hotModuleReplacement.js +60 -46
  41. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +10 -6
  42. package/compiled/mini-css-extract-plugin/index.js +10669 -10348
  43. package/compiled/mini-css-extract-plugin/loader.js +159 -100
  44. package/compiled/mini-css-extract-plugin/package.json +1 -1
  45. package/compiled/mini-css-extract-plugin/utils.js +88 -44
  46. package/compiled/postcss-loader/index.js +1 -1
  47. package/compiled/postcss-loader/package.json +1 -1
  48. package/compiled/sass-loader/index.js +1 -1
  49. package/compiled/sass-loader/package.json +1 -1
  50. package/compiled/sass-loader/sass.default.dart.js +4 -0
  51. package/compiled/schema-utils/ajv/dist/ajv.d.ts +16 -0
  52. package/compiled/schema-utils/ajv/dist/compile/codegen/code.d.ts +39 -0
  53. package/compiled/schema-utils/ajv/dist/compile/codegen/index.d.ts +79 -0
  54. package/compiled/schema-utils/ajv/dist/compile/codegen/scope.d.ts +79 -0
  55. package/compiled/schema-utils/ajv/dist/compile/errors.d.ts +13 -0
  56. package/compiled/schema-utils/ajv/dist/compile/index.d.ts +80 -0
  57. package/compiled/schema-utils/ajv/dist/compile/ref_error.d.ts +5 -0
  58. package/compiled/schema-utils/ajv/dist/compile/resolve.d.ts +12 -0
  59. package/compiled/schema-utils/ajv/dist/compile/rules.d.ts +28 -0
  60. package/compiled/schema-utils/ajv/dist/compile/util.d.ts +40 -0
  61. package/compiled/schema-utils/ajv/dist/compile/validate/index.d.ts +42 -0
  62. package/compiled/schema-utils/ajv/dist/compile/validate/subschema.d.ts +47 -0
  63. package/compiled/schema-utils/ajv/dist/core.d.ts +171 -0
  64. package/compiled/schema-utils/ajv/dist/runtime/validation_error.d.ts +7 -0
  65. package/compiled/schema-utils/ajv/dist/types/index.d.ts +177 -0
  66. package/compiled/schema-utils/ajv/dist/types/json-schema.d.ts +124 -0
  67. package/compiled/schema-utils/ajv/dist/types/jtd-schema.d.ts +168 -0
  68. package/compiled/schema-utils/declarations/validate.d.ts +4 -4
  69. package/compiled/schema-utils/index.js +8 -2
  70. package/compiled/schema-utils/uri-js/dist/es5/uri.all.d.ts +59 -0
  71. package/compiled/style-loader/index.js +1 -1
  72. package/compiled/stylus-loader/LICENSE +20 -0
  73. package/compiled/stylus-loader/index.js +44 -0
  74. package/compiled/stylus-loader/package.json +1 -0
  75. package/compiled/terser/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +90 -0
  76. package/compiled/terser/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  77. package/compiled/terser/@jridgewell/gen-mapping/dist/types/types.d.ts +35 -0
  78. package/compiled/terser/@jridgewell/source-map/dist/types/source-map.d.ts +25 -0
  79. package/compiled/terser/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  80. package/compiled/terser/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  81. package/compiled/terser/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  82. package/compiled/terser/index.js +1 -1
  83. package/compiled/terser/package.json +1 -1
  84. package/compiled/terser/tools/terser.d.ts +6 -3
  85. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts +16 -0
  86. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts +74 -0
  87. package/compiled/terser-webpack-plugin/@jridgewell/trace-mapping/dist/types/types.d.ts +92 -0
  88. package/compiled/terser-webpack-plugin/index.js +1390 -3693
  89. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +1 -0
  90. package/compiled/terser-webpack-plugin/minify.js +10 -3
  91. package/compiled/terser-webpack-plugin/package.json +1 -1
  92. package/compiled/terser-webpack-plugin/types/index.d.ts +186 -152
  93. package/compiled/terser-webpack-plugin/types/minify.d.ts +17 -0
  94. package/compiled/terser-webpack-plugin/types/utils.d.ts +20 -24
  95. package/compiled/terser-webpack-plugin/utils.js +153 -34
  96. package/compiled/webpack/BasicEffectRulePlugin.js +1 -0
  97. package/compiled/webpack/BasicEvaluatedExpression.js +1 -0
  98. package/compiled/webpack/BasicMatcherRulePlugin.js +1 -0
  99. package/compiled/webpack/ExternalsPlugin.js +1 -0
  100. package/compiled/webpack/FetchCompileAsyncWasmPlugin.js +1 -0
  101. package/compiled/webpack/FetchCompileWasmPlugin.js +1 -0
  102. package/compiled/webpack/HotModuleReplacement.runtime.js +29 -14
  103. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +4 -3
  104. package/compiled/webpack/LimitChunkCountPlugin.js +1 -0
  105. package/compiled/webpack/NodeTargetPlugin.js +1 -0
  106. package/compiled/webpack/NodeTemplatePlugin.js +1 -0
  107. package/compiled/webpack/ObjectMatcherRulePlugin.js +1 -0
  108. package/compiled/webpack/RuleSetCompiler.js +1 -0
  109. package/compiled/webpack/StringXor.js +1 -0
  110. package/compiled/webpack/UseEffectRulePlugin.js +1 -0
  111. package/compiled/webpack/WebWorkerTemplatePlugin.js +1 -0
  112. package/compiled/webpack/deepImports.json +15 -1
  113. package/compiled/webpack/index.js +26404 -10329
  114. package/compiled/webpack/json-schema/index.d.ts +8 -1
  115. package/compiled/webpack/lazy-compilation-node.js +10 -0
  116. package/compiled/webpack/lazy-compilation-web.js +9 -0
  117. package/compiled/webpack/types.d.ts +823 -287
  118. package/compiled/webpack-5-chain/index.js +1 -1
  119. package/compiled/webpack-5-chain/package.json +1 -1
  120. package/compiled/webpack-5-chain/types/index.d.ts +76 -20
  121. package/compiled/webpack-bundle-analyzer/index.js +7 -6
  122. package/compiled/webpack-bundle-analyzer/package.json +1 -1
  123. package/compiled/webpack-bundle-analyzer/public/viewer.js +2 -2
  124. package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -1
  125. package/compiled/webpack-dev-middleware/index.js +12 -5
  126. package/compiled/webpack-dev-middleware/package.json +1 -1
  127. package/compiled/{tapable → webpack-manifest-plugin}/LICENSE +2 -2
  128. package/compiled/webpack-manifest-plugin/index.js +1 -0
  129. package/compiled/webpack-manifest-plugin/package.json +1 -0
  130. package/compiled/webpack-sources/index.js +1 -1
  131. package/compiled/{express → webpackbar}/LICENSE +1 -5
  132. package/compiled/webpackbar/dist/index.d.ts +121 -0
  133. package/compiled/webpackbar/index.js +7 -0
  134. package/compiled/webpackbar/package.json +1 -0
  135. package/compiled/ws/LICENSE +13 -12
  136. package/compiled/ws/index.d.ts +74 -35
  137. package/compiled/ws/index.js +1 -1
  138. package/compiled/ws/package.json +1 -1
  139. package/dist/build.d.ts +8 -3
  140. package/dist/build.js +147 -68
  141. package/dist/cli.d.ts +0 -1
  142. package/dist/cli.js +84 -81
  143. package/dist/config/_sampleFeature.js +33 -20
  144. package/dist/config/assetRules.js +46 -55
  145. package/dist/config/bundleAnalyzerPlugin.js +41 -28
  146. package/dist/config/compressPlugin.js +125 -74
  147. package/dist/config/config.d.ts +11 -2
  148. package/dist/config/config.js +235 -172
  149. package/dist/config/copyPlugin.js +61 -47
  150. package/dist/config/cssRules.js +162 -95
  151. package/dist/config/definePlugin.d.ts +2 -0
  152. package/dist/config/definePlugin.js +59 -39
  153. package/dist/config/detectCssModulesInDependence.d.ts +10 -0
  154. package/dist/config/detectCssModulesInDependence.js +151 -0
  155. package/dist/config/detectDeadCode.d.ts +12 -0
  156. package/dist/config/detectDeadCode.js +191 -0
  157. package/dist/config/detectDeadCodePlugin.d.ts +9 -0
  158. package/dist/config/detectDeadCodePlugin.js +82 -0
  159. package/dist/config/fastRefreshPlugin.js +46 -31
  160. package/dist/config/forkTSCheckerPlugin.d.ts +11 -0
  161. package/dist/config/forkTSCheckerPlugin.js +49 -0
  162. package/dist/config/harmonyLinkingErrorPlugin.d.ts +6 -0
  163. package/dist/config/harmonyLinkingErrorPlugin.js +53 -0
  164. package/dist/config/ignorePlugin.js +38 -25
  165. package/dist/config/javaScriptRules.d.ts +2 -0
  166. package/dist/config/javaScriptRules.js +186 -150
  167. package/dist/config/manifestPlugin.d.ts +11 -0
  168. package/dist/config/manifestPlugin.js +40 -0
  169. package/dist/config/miniCSSExtractPlugin.d.ts +1 -0
  170. package/dist/config/miniCSSExtractPlugin.js +52 -31
  171. package/dist/config/nodePolyfill.js +49 -32
  172. package/dist/config/nodePrefixPlugin.d.ts +11 -0
  173. package/dist/config/nodePrefixPlugin.js +38 -0
  174. package/dist/config/progressPlugin.js +50 -24
  175. package/dist/config/purgecssWebpackPlugin.js +41 -30
  176. package/dist/config/speedMeasureWebpackPlugin.js +56 -31
  177. package/dist/config/ssrPlugin.d.ts +11 -0
  178. package/dist/config/ssrPlugin.js +98 -0
  179. package/dist/config/svgRules.d.ts +1 -0
  180. package/dist/config/svgRules.js +68 -54
  181. package/dist/constants.d.ts +4 -0
  182. package/dist/constants.js +59 -15
  183. package/dist/dev.d.ts +23 -3
  184. package/dist/dev.js +198 -81
  185. package/dist/index.d.ts +6 -2
  186. package/dist/index.js +31 -15
  187. package/dist/loader/svgr.d.ts +4 -0
  188. package/dist/loader/svgr.js +84 -0
  189. package/dist/loader/swc.d.ts +4 -0
  190. package/dist/loader/swc.js +149 -0
  191. package/dist/parcelCSS.d.ts +2 -0
  192. package/dist/parcelCSS.js +39 -0
  193. package/dist/plugins/EsbuildMinifyFix.d.ts +8 -0
  194. package/dist/plugins/EsbuildMinifyFix.js +136 -0
  195. package/dist/plugins/ProgressPlugin.js +68 -43
  196. package/dist/plugins/RuntimePublicPathPlugin.d.ts +4 -0
  197. package/dist/plugins/RuntimePublicPathPlugin.js +45 -0
  198. package/dist/plugins/_SamplePlugin.d.ts +1 -1
  199. package/dist/plugins/_SamplePlugin.js +37 -14
  200. package/dist/requireHook.js +44 -27
  201. package/dist/schema.d.ts +4 -3
  202. package/dist/schema.js +175 -69
  203. package/dist/server/server.d.ts +4 -3
  204. package/dist/server/server.js +219 -154
  205. package/dist/server/ws.d.ts +8 -3
  206. package/dist/server/ws.js +72 -38
  207. package/dist/swcPlugins/autoCSSModules.d.ts +11 -2
  208. package/dist/swcPlugins/autoCSSModules.js +60 -32
  209. package/dist/swcPlugins/changeImportFromString.d.ts +2 -0
  210. package/dist/swcPlugins/changeImportFromString.js +32 -0
  211. package/dist/swcPlugins/lockCoreJS.d.ts +6 -0
  212. package/dist/swcPlugins/lockCoreJS.js +56 -0
  213. package/dist/types.d.ts +53 -9
  214. package/dist/types.js +61 -29
  215. package/dist/utils/browsersList.js +31 -8
  216. package/dist/utils/depMatch.js +65 -39
  217. package/dist/utils/formatWebpackMessages.js +119 -91
  218. package/dist/utils/getEsBuildTarget.d.ts +7 -0
  219. package/dist/utils/getEsBuildTarget.js +46 -0
  220. package/dist/utils/pkgUpContainsName.d.ts +1 -0
  221. package/dist/utils/pkgUpContainsName.js +50 -0
  222. package/package.json +89 -81
  223. package/compiled/@svgr/webpack/.svgo.yml +0 -75
  224. package/compiled/@svgr/webpack/LICENSE +0 -7
  225. package/compiled/@svgr/webpack/index.js +0 -343
  226. package/compiled/@svgr/webpack/package.json +0 -1
  227. package/compiled/css-loader/api.js +0 -102
  228. package/compiled/css-loader/getUrl.js +0 -29
  229. package/compiled/css-loader/index.js +0 -2
  230. package/compiled/css-loader/noSourceMaps.js +0 -5
  231. package/compiled/css-loader/package.json +0 -1
  232. package/compiled/css-loader/sourceMaps.js +0 -22
  233. package/compiled/express/body-parser/index.d.ts +0 -104
  234. package/compiled/express/connect/index.d.ts +0 -93
  235. package/compiled/express/express-serve-static-core/index.d.ts +0 -1252
  236. package/compiled/express/index.d.ts +0 -133
  237. package/compiled/express/index.js +0 -338
  238. package/compiled/express/mime/index.d.ts +0 -35
  239. package/compiled/express/package.json +0 -1
  240. package/compiled/express/qs/index.d.ts +0 -62
  241. package/compiled/express/range-parser/index.d.ts +0 -35
  242. package/compiled/express/serve-static/index.d.ts +0 -108
  243. package/compiled/http-proxy-middleware/LICENSE +0 -22
  244. package/compiled/http-proxy-middleware/dist/index.d.ts +0 -4
  245. package/compiled/http-proxy-middleware/dist/types.d.ts +0 -54
  246. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +0 -226
  247. package/compiled/http-proxy-middleware/index.js +0 -66
  248. package/compiled/http-proxy-middleware/package.json +0 -1
  249. package/compiled/less/index.js +0 -31
  250. package/compiled/less/package.json +0 -1
  251. package/compiled/react-refresh/index.js +0 -19
  252. package/compiled/swc-loader/LICENSE +0 -25
  253. package/compiled/swc-loader/index.js +0 -1
  254. package/compiled/swc-loader/package.json +0 -1
  255. package/compiled/tapable/index.js +0 -1
  256. package/compiled/tapable/package.json +0 -1
  257. package/compiled/tapable/tapable.d.ts +0 -116
  258. package/dist/build.d.ts.map +0 -1
  259. package/dist/cli.d.ts.map +0 -1
  260. package/dist/client/client.d.ts.map +0 -1
  261. package/dist/client/client.js +0 -239
  262. package/dist/config/_sampleFeature.d.ts.map +0 -1
  263. package/dist/config/assetRules.d.ts.map +0 -1
  264. package/dist/config/bundleAnalyzerPlugin.d.ts.map +0 -1
  265. package/dist/config/compressPlugin.d.ts.map +0 -1
  266. package/dist/config/config.d.ts.map +0 -1
  267. package/dist/config/copyPlugin.d.ts.map +0 -1
  268. package/dist/config/cssRules.d.ts.map +0 -1
  269. package/dist/config/definePlugin.d.ts.map +0 -1
  270. package/dist/config/fastRefreshPlugin.d.ts.map +0 -1
  271. package/dist/config/ignorePlugin.d.ts.map +0 -1
  272. package/dist/config/javaScriptRules.d.ts.map +0 -1
  273. package/dist/config/miniCSSExtractPlugin.d.ts.map +0 -1
  274. package/dist/config/nodePolyfill.d.ts.map +0 -1
  275. package/dist/config/progressPlugin.d.ts.map +0 -1
  276. package/dist/config/purgecssWebpackPlugin.d.ts.map +0 -1
  277. package/dist/config/speedMeasureWebpackPlugin.d.ts.map +0 -1
  278. package/dist/config/svgRules.d.ts.map +0 -1
  279. package/dist/constants.d.ts.map +0 -1
  280. package/dist/dev.d.ts.map +0 -1
  281. package/dist/index.d.ts.map +0 -1
  282. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +0 -11
  283. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts.map +0 -1
  284. package/dist/plugins/ESBuildCSSMinifyPlugin.js +0 -65
  285. package/dist/plugins/ProgressPlugin.d.ts.map +0 -1
  286. package/dist/plugins/_SamplePlugin.d.ts.map +0 -1
  287. package/dist/requireHook.d.ts.map +0 -1
  288. package/dist/schema.d.ts.map +0 -1
  289. package/dist/server/server.d.ts.map +0 -1
  290. package/dist/server/ws.d.ts.map +0 -1
  291. package/dist/swcPlugins/autoCSSModules.d.ts.map +0 -1
  292. package/dist/types.d.ts.map +0 -1
  293. package/dist/utils/browsersList.d.ts.map +0 -1
  294. package/dist/utils/depMatch.d.ts.map +0 -1
  295. package/dist/utils/formatWebpackMessages.d.ts.map +0 -1
  296. /package/{dist → client}/client/client.d.ts +0 -0
  297. /package/compiled/{css-loader → file-loader}/LICENSE +0 -0
@@ -1,239 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
- return new (P || (P = Promise))(function (resolve, reject) {
24
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- var __importDefault = (this && this.__importDefault) || function (mod) {
31
- return (mod && mod.__esModule) ? mod : { "default": mod };
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- const strip_ansi_1 = __importDefault(require("@umijs/utils/compiled/strip-ansi"));
35
- // @ts-ignore
36
- const ErrorOverlay = __importStar(require("react-error-overlay"));
37
- const constants_1 = require("../constants");
38
- const formatWebpackMessages_1 = require("../utils/formatWebpackMessages");
39
- console.log('[webpack] connecting...');
40
- let pingTimer = null;
41
- const host = location.host;
42
- const wsUrl = `ws://${host}`;
43
- let isFirstCompilation = true;
44
- let mostRecentCompilationHash = null;
45
- let hasCompileErrors = false;
46
- let hadRuntimeError = false;
47
- const socket = new WebSocket(wsUrl, 'webpack-hmr');
48
- socket.addEventListener('message', ({ data }) => __awaiter(void 0, void 0, void 0, function* () {
49
- data = JSON.parse(data);
50
- if (data.type === 'connected') {
51
- console.log(`[webpack] connected.`);
52
- // proxy(nginx, docker) hmr ws maybe caused timeout,
53
- // so send ping package let ws keep alive.
54
- pingTimer = setInterval(() => socket.send('ping'), 30000);
55
- }
56
- else {
57
- handleMessage(data).catch(console.error);
58
- }
59
- }));
60
- function waitForSuccessfulPing(ms = 1000) {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- // eslint-disable-next-line no-constant-condition
63
- while (true) {
64
- try {
65
- yield fetch(`/__umi_ping`);
66
- break;
67
- }
68
- catch (e) {
69
- yield new Promise((resolve) => setTimeout(resolve, ms));
70
- }
71
- }
72
- });
73
- }
74
- socket.addEventListener('close', () => __awaiter(void 0, void 0, void 0, function* () {
75
- if (pingTimer)
76
- clearInterval(pingTimer);
77
- console.info('[webpack] Dev server disconnected. Polling for restart...');
78
- yield waitForSuccessfulPing();
79
- location.reload();
80
- }));
81
- ErrorOverlay.startReportingRuntimeErrors({
82
- onError: function () {
83
- hadRuntimeError = true;
84
- },
85
- filename: '/static/js/bundle.js',
86
- });
87
- // @ts-ignore
88
- if (module.hot && typeof module.hot.dispose === 'function') {
89
- // @ts-ignore
90
- module.hot.dispose(function () {
91
- // TODO: why do we need this?
92
- ErrorOverlay.stopReportingRuntimeErrors();
93
- });
94
- }
95
- // There is a newer version of the code available.
96
- function handleAvailableHash(hash) {
97
- // Update last known compilation hash.
98
- mostRecentCompilationHash = hash;
99
- }
100
- function handleSuccess() {
101
- const isHotUpdate = !isFirstCompilation;
102
- isFirstCompilation = false;
103
- hasCompileErrors = false;
104
- // Attempt to apply hot updates or reload.
105
- if (isHotUpdate) {
106
- tryApplyUpdates(function onHotUpdateSuccess() {
107
- // Only dismiss it when we're sure it's a hot update.
108
- // Otherwise it would flicker right before the reload.
109
- tryDismissErrorOverlay();
110
- });
111
- }
112
- }
113
- function handleWarnings(warnings) {
114
- const isHotUpdate = !isFirstCompilation;
115
- isFirstCompilation = false;
116
- hasCompileErrors = false;
117
- const formatted = (0, formatWebpackMessages_1.formatWebpackMessages)({
118
- warnings,
119
- errors: [],
120
- });
121
- // print warnings
122
- if (typeof console !== 'undefined' && typeof console.warn === 'function') {
123
- for (let i = 0; i < formatted.warnings.length; i++) {
124
- if (i === 5) {
125
- console.warn('There were more warnings in other files.\n' +
126
- 'You can find a complete log in the terminal.');
127
- break;
128
- }
129
- console.warn((0, strip_ansi_1.default)(formatted.warnings[i]));
130
- }
131
- }
132
- // Attempt to apply hot updates or reload.
133
- if (isHotUpdate) {
134
- tryApplyUpdates(function onSuccessfulHotUpdate() {
135
- // Only dismiss it when we're sure it's a hot update.
136
- // Otherwise it would flicker right before the reload.
137
- tryDismissErrorOverlay();
138
- });
139
- }
140
- }
141
- function handleErrors(errors) {
142
- isFirstCompilation = false;
143
- hasCompileErrors = true;
144
- const formatted = (0, formatWebpackMessages_1.formatWebpackMessages)({
145
- warnings: [],
146
- errors,
147
- });
148
- // Only show the first error.
149
- ErrorOverlay.reportBuildError(formatted.errors[0]);
150
- // Also log them to the console.
151
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
152
- for (let i = 0; i < formatted.errors.length; i++) {
153
- console.error((0, strip_ansi_1.default)(formatted.errors[i]));
154
- }
155
- }
156
- }
157
- function tryDismissErrorOverlay() {
158
- if (!hasCompileErrors) {
159
- ErrorOverlay.dismissBuildError();
160
- }
161
- }
162
- // Is there a newer version of this code available?
163
- function isUpdateAvailable() {
164
- // @ts-ignore
165
- return mostRecentCompilationHash !== __webpack_hash__;
166
- }
167
- function canApplyUpdates() {
168
- // @ts-ignore
169
- return module.hot.status() === 'idle';
170
- }
171
- function canAcceptErrors() {
172
- // NOTE: This var is injected by Webpack's DefinePlugin, and is a boolean instead of string.
173
- const hasReactRefresh = process.env.FAST_REFRESH;
174
- // @ts-ignore
175
- const status = module.hot.status();
176
- // React refresh can handle hot-reloading over errors.
177
- // However, when hot-reload status is abort or fail,
178
- // it indicates the current update cannot be applied safely,
179
- // and thus we should bail out to a forced reload for consistency.
180
- return hasReactRefresh && ['abort', 'fail'].indexOf(status) === -1;
181
- }
182
- function tryApplyUpdates(onHotUpdateSuccess) {
183
- // @ts-ignore
184
- if (!module.hot) {
185
- window.location.reload();
186
- return;
187
- }
188
- if (!isUpdateAvailable() || !canApplyUpdates()) {
189
- return;
190
- }
191
- function handleApplyUpdates(err, updatedModules) {
192
- const haveErrors = err || hadRuntimeError;
193
- // When there is no error but updatedModules is unavailable,
194
- // it indicates a critical failure in hot-reloading,
195
- // e.g. server is not ready to serve new bundle,
196
- // and hence we need to do a forced reload.
197
- const needsForcedReload = !err && !updatedModules;
198
- if ((haveErrors && !canAcceptErrors()) || needsForcedReload) {
199
- window.location.reload();
200
- }
201
- if (onHotUpdateSuccess)
202
- onHotUpdateSuccess();
203
- // While we were updating, there was a new update! Do it again.
204
- if (isUpdateAvailable()) {
205
- tryApplyUpdates();
206
- }
207
- }
208
- // @ts-ignore
209
- module.hot
210
- .check(/* autoApply */ true)
211
- .then((updatedModules) => {
212
- handleApplyUpdates(null, updatedModules);
213
- })
214
- .catch((err) => {
215
- handleApplyUpdates(err, null);
216
- });
217
- }
218
- function handleMessage(payload) {
219
- return __awaiter(this, void 0, void 0, function* () {
220
- // console.log('[payload]', payload);
221
- switch (payload.type) {
222
- case constants_1.MESSAGE_TYPE.hash:
223
- handleAvailableHash(payload.data);
224
- break;
225
- case constants_1.MESSAGE_TYPE.stillOk:
226
- case constants_1.MESSAGE_TYPE.ok:
227
- handleSuccess();
228
- break;
229
- case constants_1.MESSAGE_TYPE.errors:
230
- handleErrors(payload.data);
231
- break;
232
- case constants_1.MESSAGE_TYPE.warnings:
233
- handleWarnings(payload.data);
234
- break;
235
- default:
236
- // Do nothing
237
- }
238
- });
239
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"_sampleFeature.d.ts","sourceRoot":"","sources":["../../src/config/_sampleFeature.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,KAAK,iBAMjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"assetRules.d.ts","sourceRoot":"","sources":["../../src/config/assetRules.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,KAAK,iBA6C9C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundleAnalyzerPlugin.d.ts","sourceRoot":"","sources":["../../src/config/bundleAnalyzerPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AAGrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,KAAK,iBAYxD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compressPlugin.d.ts","sourceRoot":"","sources":["../../src/config/compressPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,MAAM,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAe,GAAG,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAEjE,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,KAAK,iBAqDlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAiBxC,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,mBAAmB,CAAC,EAAE,QAAQ,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,aAAa,CAAC,CAiKnE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyPlugin.d.ts","sourceRoot":"","sources":["../../src/config/copyPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AAGrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,KAAK,iBA+B9C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cssRules.d.ts","sourceRoot":"","sources":["../../src/config/cssRules.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,KAAK,iBAmH5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"definePlugin.d.ts","sourceRoot":"","sources":["../../src/config/definePlugin.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,GAAG,CAAA;CAAE;;EAuBlD;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,KAAK,iBAOhD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fastRefreshPlugin.d.ts","sourceRoot":"","sources":["../../src/config/fastRefreshPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,KAAK,iBAYrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignorePlugin.d.ts","sourceRoot":"","sources":["../../src/config/ignorePlugin.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,KAAK,iBAUhD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"javaScriptRules.d.ts","sourceRoot":"","sources":["../../src/config/javaScriptRules.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,gCAAgC,CAAC;AAGpD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAGpD,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,iBAAiB,EAAE,GAAG,EAAE,CAAC;IACzB,iBAAiB,EAAE,GAAG,EAAE,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,KAAK,iBAkInD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"miniCSSExtractPlugin.d.ts","sourceRoot":"","sources":["../../src/config/miniCSSExtractPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,KAAK,iBAcxD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"nodePolyfill.d.ts","sourceRoot":"","sources":["../../src/config/nodePolyfill.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,KAAK,iBAsBhD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"progressPlugin.d.ts","sourceRoot":"","sources":["../../src/config/progressPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,KAAK,iBAOlD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"purgecssWebpackPlugin.d.ts","sourceRoot":"","sources":["../../src/config/purgecssWebpackPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;CACV;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,KAAK,iBAgB3D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"speedMeasureWebpackPlugin.d.ts","sourceRoot":"","sources":["../../src/config/speedMeasureWebpackPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,UAAU,KAAK;IACb,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,wBAAsB,4BAA4B,CAAC,IAAI,EAAE,KAAK,0BAa7D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"svgRules.d.ts","sourceRoot":"","sources":["../../src/config/svgRules.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iDAAiD,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,KAAK,iBA4C5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,4BAA4B,CAAC;AACzD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,oBAAY,YAAY;IACtB,EAAE,OAAO;IACT,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,OAAO,aAAa;IACpB,OAAO,YAAY;CACpB"}
package/dist/dev.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAKA,OAAO,EAAO,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,UAAU,KAAK;IACb,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,mBAAmB,CAAC,EAAE,QAAQ,CAAC;IAC/B,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC3B,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,wBAAsB,GAAG,CAAC,IAAI,EAAE,KAAK,iBA4DpC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
@@ -1,11 +0,0 @@
1
- import { Compilation, Compiler } from '@umijs/bundler-webpack/compiled/webpack';
2
- interface IOpts {
3
- sourcemap?: any;
4
- }
5
- declare class ESBuildCSSMinifyPlugin {
6
- options: IOpts;
7
- constructor(options?: IOpts);
8
- apply(compiler: Compiler): void;
9
- transformAssets(compilation: Compilation): Promise<void>;
10
- }
11
- export default ESBuildCSSMinifyPlugin;
@@ -1 +0,0 @@
1
- {"version":3,"file":"ESBuildCSSMinifyPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ESBuildCSSMinifyPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAQhF,UAAU,KAAK;IACb,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB;AAKD,cAAM,sBAAsB;IACnB,OAAO,EAAE,KAAK,CAAC;gBACV,OAAO,GAAE,KAAU;IAI/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAuBzB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAuC/D;AAED,eAAe,sBAAsB,CAAC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const esbuild_1 = require("@umijs/bundler-utils/compiled/esbuild");
13
- const webpack_sources_1 = require("@umijs/bundler-webpack/compiled/webpack-sources");
14
- const version = require('../../package.json');
15
- const PLUGIN_NAME = 'ESBuildCSSMinifyPlugin';
16
- const RE_CSS_FILE = /\.css(\?.*)?$/i;
17
- class ESBuildCSSMinifyPlugin {
18
- constructor(options = {}) {
19
- this.options = options;
20
- }
21
- apply(compiler) {
22
- compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
23
- compilation.hooks.chunkHash.tap(PLUGIN_NAME, (_, hash) => {
24
- hash.update(JSON.stringify({
25
- version,
26
- options: this.options,
27
- }));
28
- });
29
- compilation.hooks.processAssets.tapPromise({
30
- name: PLUGIN_NAME,
31
- stage: 400,
32
- additionalAssets: true,
33
- }, () => __awaiter(this, void 0, void 0, function* () {
34
- yield this.transformAssets(compilation);
35
- }));
36
- });
37
- }
38
- transformAssets(compilation) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const { options: { devtool }, } = compilation.compiler;
41
- const sourcemap = this.options.sourcemap === undefined
42
- ? devtool && devtool
43
- : this.options.sourcemap;
44
- const assets = compilation.getAssets().filter((asset) => {
45
- return !asset.info.minimized && RE_CSS_FILE.test(asset.name);
46
- });
47
- yield Promise.all(assets.map((asset) => __awaiter(this, void 0, void 0, function* () {
48
- const { source, map } = asset.source.sourceAndMap();
49
- const sourceAsString = source.toString();
50
- const result = yield (0, esbuild_1.transform)(sourceAsString, {
51
- loader: 'css',
52
- sourcemap,
53
- sourcefile: asset.name,
54
- minify: true,
55
- });
56
- compilation.updateAsset(asset.name,
57
- // @ts-ignore
58
- sourcemap
59
- ? new webpack_sources_1.SourceMapSource(result.code, asset.name, result.map, sourceAsString, map, true)
60
- : new webpack_sources_1.RawSource(result.code), Object.assign(Object.assign({}, asset.info), { minimized: true }));
61
- })));
62
- });
63
- }
64
- }
65
- exports.default = ESBuildCSSMinifyPlugin;
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProgressPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ProgressPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,cAAc,EAEf,MAAM,yCAAyC,CAAC;AAIjD,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,cAAM,iBAAkB,SAAQ,cAAc;IACrC,OAAO,EAAE,KAAK,CAAC;gBAEV,OAAO,GAAE,KAAU;IAS/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAgC/B,cAAc,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,EAAE,CAAA;KAAE;CAG1E;AAED,eAAe,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_SamplePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/_SamplePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAInE,UAAU,KAAK;CAAG;AAElB,cAAM,aAAa;IACV,OAAO,EAAE,KAAK,CAAC;gBAEV,OAAO,GAAE,KAAU;IAI/B,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAKhC;AAED,eAAe,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"requireHook.d.ts","sourceRoot":"","sources":["../src/requireHook.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAyBtC,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,CAiG/D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":";AAEA,OAAgB,EACd,aAAa,EACd,MAAM,yCAAyC,CAAC;AAGjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC1B,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,QAAQ,CAAC;CAC7B;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,KAAK,wBAsJ7C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src/server/ws.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAE1C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM;kBA0BlC,MAAM;;;EAcvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"autoCSSModules.d.ts","sourceRoot":"","sources":["../../src/swcPlugins/autoCSSModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAKxC,cAAM,aAAc,SAAQ,OAAO;IACjC,WAAW,CAAC,UAAU,EAAE,MAAM;IAI9B,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,GAAG,iBAAiB;IAgBxE,wBAAwB,CACtB,UAAU,EAAE,mBAAmB,GAC9B,mBAAmB;CAkBvB;AAED,eAAe,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"browsersList.d.ts","sourceRoot":"","sources":["../../src/utils/browsersList.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,OAOjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"depMatch.d.ts","sourceRoot":"","sources":["../../src/utils/depMatch.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,SAEzB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;CACrD,GAAG,OAAO,CAwBV;AAED,wBAAgB,4BAA4B,6BAQ3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatWebpackMessages.d.ts","sourceRoot":"","sources":["../../src/utils/formatWebpackMessages.ts"],"names":[],"mappings":"AAQA,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,UAoG9D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;;;EAaA"}
File without changes
File without changes