@umijs/bundler-webpack 3.5.18 → 4.0.0-beta.10

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 (334) hide show
  1. package/README.md +2 -0
  2. package/bin/bundler-webpack.js +1 -2
  3. package/client/client/client.js +202 -0
  4. package/client/constants.js +12 -0
  5. package/client/utils/formatWebpackMessages.js +92 -0
  6. package/compiled/@svgr/webpack/LICENSE +7 -0
  7. package/compiled/@svgr/webpack/index.js +266 -0
  8. package/compiled/@svgr/webpack/package.json +1 -0
  9. package/compiled/autoprefixer/LICENSE +20 -0
  10. package/compiled/autoprefixer/browserslist/index.d.ts +172 -0
  11. package/compiled/autoprefixer/index.js +9 -0
  12. package/compiled/autoprefixer/lib/autoprefixer.d.ts +95 -0
  13. package/compiled/autoprefixer/package.json +1 -0
  14. package/compiled/autoprefixer/postcss/lib/at-rule.d.ts +106 -0
  15. package/compiled/autoprefixer/postcss/lib/comment.d.ts +56 -0
  16. package/compiled/autoprefixer/postcss/lib/container.d.ts +442 -0
  17. package/compiled/autoprefixer/postcss/lib/css-syntax-error.d.ts +192 -0
  18. package/compiled/autoprefixer/postcss/lib/declaration.d.ts +124 -0
  19. package/compiled/autoprefixer/postcss/lib/document.d.ts +57 -0
  20. package/compiled/autoprefixer/postcss/lib/input.d.ts +130 -0
  21. package/compiled/autoprefixer/postcss/lib/lazy-result.d.ts +175 -0
  22. package/compiled/autoprefixer/postcss/lib/list.d.ts +51 -0
  23. package/compiled/autoprefixer/postcss/lib/node.d.ts +444 -0
  24. package/compiled/autoprefixer/postcss/lib/postcss.d.ts +472 -0
  25. package/compiled/autoprefixer/postcss/lib/previous-map.d.ts +72 -0
  26. package/compiled/autoprefixer/postcss/lib/processor.d.ts +101 -0
  27. package/compiled/autoprefixer/postcss/lib/result.d.ts +195 -0
  28. package/compiled/autoprefixer/postcss/lib/root.d.ts +73 -0
  29. package/compiled/autoprefixer/postcss/lib/rule.d.ts +104 -0
  30. package/compiled/autoprefixer/postcss/lib/warning.d.ts +104 -0
  31. package/compiled/autoprefixer/source-map-js/source-map.d.ts +98 -0
  32. package/compiled/babel-loader/LICENSE +22 -0
  33. package/compiled/babel-loader/index.js +3 -0
  34. package/compiled/babel-loader/package.json +1 -0
  35. package/compiled/compression/LICENSE +23 -0
  36. package/compiled/compression/index.js +57 -0
  37. package/compiled/compression/package.json +1 -0
  38. package/compiled/connect-history-api-fallback/LICENSE +21 -0
  39. package/compiled/connect-history-api-fallback/index.js +1 -0
  40. package/compiled/connect-history-api-fallback/package.json +1 -0
  41. package/{lib/webpack/plugins/mini-css-extract-plugin → compiled/copy-webpack-plugin}/LICENSE +0 -0
  42. package/compiled/copy-webpack-plugin/index.js +46 -0
  43. package/compiled/copy-webpack-plugin/package.json +1 -0
  44. package/{lib/webpack/plugins/terser-webpack-plugin → compiled/css-loader}/LICENSE +0 -0
  45. package/compiled/css-loader/api.js +102 -0
  46. package/compiled/css-loader/getUrl.js +29 -0
  47. package/compiled/css-loader/index.js +2 -0
  48. package/compiled/css-loader/noSourceMaps.js +5 -0
  49. package/compiled/css-loader/package.json +1 -0
  50. package/compiled/css-loader/sourceMaps.js +22 -0
  51. package/compiled/css-minimizer-webpack-plugin/LICENSE +20 -0
  52. package/compiled/css-minimizer-webpack-plugin/index.js +3 -0
  53. package/compiled/css-minimizer-webpack-plugin/minify.js +72 -0
  54. package/compiled/css-minimizer-webpack-plugin/package.json +1 -0
  55. package/compiled/css-minimizer-webpack-plugin/utils.js +166 -0
  56. package/compiled/cssnano/index.js +192 -0
  57. package/compiled/cssnano/package.json +1 -0
  58. package/compiled/express/LICENSE +24 -0
  59. package/compiled/express/body-parser/index.d.ts +104 -0
  60. package/compiled/express/connect/index.d.ts +93 -0
  61. package/compiled/express/express-serve-static-core/index.d.ts +1252 -0
  62. package/compiled/express/index.d.ts +133 -0
  63. package/compiled/express/index.js +338 -0
  64. package/compiled/express/mime/index.d.ts +35 -0
  65. package/compiled/express/package.json +1 -0
  66. package/compiled/express/qs/index.d.ts +62 -0
  67. package/compiled/express/range-parser/index.d.ts +35 -0
  68. package/compiled/express/serve-static/index.d.ts +108 -0
  69. package/compiled/http-proxy-middleware/LICENSE +22 -0
  70. package/compiled/http-proxy-middleware/dist/index.d.ts +4 -0
  71. package/compiled/http-proxy-middleware/dist/types.d.ts +54 -0
  72. package/compiled/http-proxy-middleware/http-proxy/index.d.ts +226 -0
  73. package/compiled/http-proxy-middleware/index.js +66 -0
  74. package/compiled/http-proxy-middleware/package.json +1 -0
  75. package/compiled/less/index.js +31 -0
  76. package/compiled/less/package.json +1 -0
  77. package/compiled/less-loader/LICENSE +20 -0
  78. package/compiled/less-loader/index.js +1 -0
  79. package/compiled/less-loader/package.json +1 -0
  80. package/compiled/mini-css-extract-plugin/LICENSE +20 -0
  81. package/{lib/webpack/plugins/mini-css-extract-plugin/src → compiled/mini-css-extract-plugin}/hmr/hotModuleReplacement.js +50 -52
  82. package/compiled/mini-css-extract-plugin/hmr/normalize-url.js +35 -0
  83. package/compiled/mini-css-extract-plugin/index.js +11606 -0
  84. package/compiled/mini-css-extract-plugin/loader-options.json +32 -0
  85. package/compiled/mini-css-extract-plugin/loader.js +315 -0
  86. package/compiled/mini-css-extract-plugin/package.json +1 -0
  87. package/compiled/mini-css-extract-plugin/utils.js +154 -0
  88. package/compiled/postcss-flexbugs-fixes/LICENSE +20 -0
  89. package/compiled/postcss-flexbugs-fixes/index.js +1 -0
  90. package/compiled/postcss-flexbugs-fixes/package.json +1 -0
  91. package/compiled/postcss-loader/LICENSE +20 -0
  92. package/compiled/postcss-loader/index.js +1 -0
  93. package/compiled/postcss-loader/package.json +1 -0
  94. package/compiled/purgecss-webpack-plugin/LICENSE +21 -0
  95. package/compiled/purgecss-webpack-plugin/index.js +7781 -0
  96. package/compiled/purgecss-webpack-plugin/package.json +1 -0
  97. package/compiled/react-refresh/index.js +19 -0
  98. package/compiled/sass-loader/LICENSE +20 -0
  99. package/compiled/sass-loader/index.js +1 -0
  100. package/compiled/sass-loader/package.json +1 -0
  101. package/compiled/schema-utils/LICENSE +20 -0
  102. package/compiled/schema-utils/ajv/lib/ajv.d.ts +397 -0
  103. package/compiled/schema-utils/declarations/ValidationError.d.ts +74 -0
  104. package/compiled/schema-utils/declarations/index.d.ts +3 -0
  105. package/compiled/schema-utils/declarations/validate.d.ts +37 -0
  106. package/compiled/schema-utils/index.js +3 -0
  107. package/compiled/schema-utils/json-schema/index.d.ts +751 -0
  108. package/compiled/schema-utils/package.json +1 -0
  109. package/compiled/speed-measure-webpack-plugin/LICENSE +21 -0
  110. package/compiled/speed-measure-webpack-plugin/index.js +1 -0
  111. package/compiled/speed-measure-webpack-plugin/package.json +1 -0
  112. package/compiled/style-loader/LICENSE +20 -0
  113. package/compiled/style-loader/index.js +1 -0
  114. package/compiled/style-loader/package.json +1 -0
  115. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  116. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +104 -0
  117. package/compiled/style-loader/runtime/insertBySelector.js +39 -0
  118. package/compiled/style-loader/runtime/insertStyleElement.js +11 -0
  119. package/compiled/style-loader/runtime/isEqualLocals.js +35 -0
  120. package/compiled/style-loader/runtime/isOldIE.js +19 -0
  121. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +16 -0
  122. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +10 -0
  123. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +12 -0
  124. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +93 -0
  125. package/compiled/style-loader/runtime/styleDomAPI.js +70 -0
  126. package/compiled/style-loader/runtime/styleTagTransform.js +16 -0
  127. package/compiled/svgo-loader/LICENSE +22 -0
  128. package/compiled/svgo-loader/index.js +4 -0
  129. package/compiled/svgo-loader/package.json +1 -0
  130. package/compiled/swc-loader/LICENSE +25 -0
  131. package/compiled/swc-loader/index.js +1 -0
  132. package/compiled/swc-loader/package.json +1 -0
  133. package/compiled/tapable/LICENSE +21 -0
  134. package/compiled/tapable/index.js +1 -0
  135. package/compiled/tapable/package.json +1 -0
  136. package/compiled/tapable/tapable.d.ts +116 -0
  137. package/compiled/terser/LICENSE +29 -0
  138. package/compiled/terser/index.js +1 -0
  139. package/compiled/terser/mappings.wasm +0 -0
  140. package/compiled/terser/package.json +1 -0
  141. package/compiled/terser/source-map/source-map.d.ts +369 -0
  142. package/compiled/terser/tools/terser.d.ts +207 -0
  143. package/compiled/terser-webpack-plugin/LICENSE +20 -0
  144. package/compiled/terser-webpack-plugin/ajv/lib/ajv.d.ts +397 -0
  145. package/compiled/terser-webpack-plugin/index.js +15142 -0
  146. package/compiled/terser-webpack-plugin/jest-worker/build/index.d.ts +49 -0
  147. package/compiled/terser-webpack-plugin/jest-worker/build/types.d.ts +142 -0
  148. package/compiled/terser-webpack-plugin/json-schema/index.d.ts +751 -0
  149. package/compiled/terser-webpack-plugin/minify.js +43 -0
  150. package/compiled/terser-webpack-plugin/package.json +1 -0
  151. package/compiled/terser-webpack-plugin/schema-utils/declarations/ValidationError.d.ts +74 -0
  152. package/compiled/terser-webpack-plugin/schema-utils/declarations/index.d.ts +3 -0
  153. package/compiled/terser-webpack-plugin/schema-utils/declarations/validate.d.ts +37 -0
  154. package/compiled/terser-webpack-plugin/source-map/source-map.d.ts +98 -0
  155. package/compiled/terser-webpack-plugin/types/cjs.d.ts +3 -0
  156. package/compiled/terser-webpack-plugin/types/index.d.ts +295 -0
  157. package/compiled/terser-webpack-plugin/types/utils.d.ts +105 -0
  158. package/compiled/terser-webpack-plugin/utils.js +594 -0
  159. package/compiled/url-loader/LICENSE +20 -0
  160. package/compiled/url-loader/index.js +15 -0
  161. package/compiled/url-loader/package.json +1 -0
  162. package/compiled/webpack/Chunk.js +1 -0
  163. package/compiled/webpack/Compilation.js +1 -0
  164. package/compiled/webpack/HotModuleReplacement.runtime.js +394 -0
  165. package/compiled/webpack/JavascriptHotModuleReplacement.runtime.js +462 -0
  166. package/compiled/webpack/LICENSE +20 -0
  167. package/compiled/webpack/LibraryTemplatePlugin.js +1 -0
  168. package/compiled/webpack/LoaderTargetPlugin.js +1 -0
  169. package/compiled/webpack/ModuleFilenameHelpers.js +1 -0
  170. package/compiled/webpack/NormalModule.js +1 -0
  171. package/compiled/webpack/RuntimeGlobals.js +1 -0
  172. package/compiled/webpack/RuntimeModule.js +1 -0
  173. package/compiled/webpack/SingleEntryPlugin.js +1 -0
  174. package/compiled/webpack/Template.js +1 -0
  175. package/compiled/webpack/ajv/lib/ajv.d.ts +397 -0
  176. package/compiled/webpack/deepImports.json +12 -0
  177. package/compiled/webpack/index.js +162861 -0
  178. package/compiled/webpack/json-schema/index.d.ts +751 -0
  179. package/compiled/webpack/lazy-compilation-node.js +40 -0
  180. package/compiled/webpack/lazy-compilation-web.js +74 -0
  181. package/compiled/webpack/package.json +5 -0
  182. package/compiled/webpack/schema-utils/declarations/ValidationError.d.ts +74 -0
  183. package/compiled/webpack/schema-utils/declarations/index.d.ts +3 -0
  184. package/compiled/webpack/schema-utils/declarations/validate.d.ts +37 -0
  185. package/compiled/webpack/types.d.ts +12664 -0
  186. package/compiled/webpack-5-chain/LICENSE +373 -0
  187. package/compiled/webpack-5-chain/index.js +1 -0
  188. package/compiled/webpack-5-chain/package.json +1 -0
  189. package/compiled/webpack-5-chain/types/index.d.ts +543 -0
  190. package/compiled/webpack-bundle-analyzer/LICENSE +20 -0
  191. package/compiled/webpack-bundle-analyzer/index.js +30 -0
  192. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  193. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  194. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  195. package/compiled/webpack-bundle-analyzer/public/viewer.js.map +1 -0
  196. package/compiled/webpack-dev-middleware/LICENSE +20 -0
  197. package/compiled/webpack-dev-middleware/index.js +21 -0
  198. package/compiled/webpack-dev-middleware/package.json +1 -0
  199. package/compiled/webpack-sources/LICENSE +21 -0
  200. package/compiled/webpack-sources/index.d.ts +20 -0
  201. package/compiled/webpack-sources/index.js +1 -0
  202. package/compiled/webpack-sources/lib/CachedSource.d.ts +18 -0
  203. package/compiled/webpack-sources/lib/CompatSource.d.ts +9 -0
  204. package/compiled/webpack-sources/lib/ConcatSource.d.ts +22 -0
  205. package/compiled/webpack-sources/lib/OriginalSource.d.ts +18 -0
  206. package/compiled/webpack-sources/lib/PrefixSource.d.ts +12 -0
  207. package/compiled/webpack-sources/lib/RawSource.d.ts +13 -0
  208. package/compiled/webpack-sources/lib/ReplaceSource.d.ts +35 -0
  209. package/compiled/webpack-sources/lib/SizeOnlySource.d.ts +7 -0
  210. package/compiled/webpack-sources/lib/Source.d.ts +45 -0
  211. package/compiled/webpack-sources/lib/SourceMapSource.d.ts +22 -0
  212. package/compiled/webpack-sources/lib/index.d.ts +60 -0
  213. package/compiled/webpack-sources/package.json +1 -0
  214. package/compiled/webpack-sources/source-list-map/index.d.ts +91 -0
  215. package/compiled/webpack-sources/source-map/source-map.d.ts +369 -0
  216. package/compiled/ws/LICENSE +19 -0
  217. package/compiled/ws/index.d.ts +359 -0
  218. package/compiled/ws/index.js +1 -0
  219. package/compiled/ws/package.json +1 -0
  220. package/dist/build.d.ts +17 -0
  221. package/dist/build.js +72 -0
  222. package/{lib → dist}/cli.d.ts +0 -0
  223. package/dist/cli.js +93 -0
  224. package/{lib/webpackHotDevClient/webpackHotDevClient.d.ts → dist/client/client.d.ts} +0 -0
  225. package/dist/client/client.js +239 -0
  226. package/dist/config/_sampleFeature.d.ts +10 -0
  227. package/dist/config/_sampleFeature.js +22 -0
  228. package/dist/config/assetRules.d.ts +11 -0
  229. package/dist/config/assetRules.js +69 -0
  230. package/dist/config/bundleAnalyzerPlugin.d.ts +10 -0
  231. package/dist/config/bundleAnalyzerPlugin.js +30 -0
  232. package/dist/config/compressPlugin.d.ts +10 -0
  233. package/dist/config/compressPlugin.js +77 -0
  234. package/dist/config/config.d.ts +20 -0
  235. package/dist/config/config.js +178 -0
  236. package/dist/config/copyPlugin.d.ts +10 -0
  237. package/dist/config/copyPlugin.js +49 -0
  238. package/dist/config/cssRules.d.ts +11 -0
  239. package/dist/config/cssRules.js +98 -0
  240. package/dist/config/definePlugin.d.ts +15 -0
  241. package/dist/config/definePlugin.js +45 -0
  242. package/dist/config/fastRefreshPlugin.d.ts +12 -0
  243. package/dist/config/fastRefreshPlugin.js +34 -0
  244. package/dist/config/ignorePlugin.d.ts +10 -0
  245. package/dist/config/ignorePlugin.js +27 -0
  246. package/dist/config/javaScriptRules.d.ts +14 -0
  247. package/dist/config/javaScriptRules.js +155 -0
  248. package/dist/config/miniCSSExtractPlugin.d.ts +10 -0
  249. package/dist/config/miniCSSExtractPlugin.js +34 -0
  250. package/dist/config/nodePolyfill.d.ts +10 -0
  251. package/dist/config/nodePolyfill.js +34 -0
  252. package/dist/config/progressPlugin.d.ts +11 -0
  253. package/dist/config/progressPlugin.js +27 -0
  254. package/dist/config/purgecssWebpackPlugin.d.ts +10 -0
  255. package/dist/config/purgecssWebpackPlugin.js +32 -0
  256. package/dist/config/speedMeasureWebpackPlugin.d.ts +6 -0
  257. package/dist/config/speedMeasureWebpackPlugin.js +34 -0
  258. package/dist/config/svgRules.d.ts +11 -0
  259. package/dist/config/svgRules.js +43 -0
  260. package/dist/constants.d.ts +11 -0
  261. package/dist/constants.js +15 -0
  262. package/dist/dev.d.ts +19 -0
  263. package/dist/dev.js +87 -0
  264. package/dist/index.d.ts +5 -0
  265. package/dist/index.js +16 -0
  266. package/dist/plugins/ESBuildCSSMinifyPlugin.d.ts +11 -0
  267. package/dist/plugins/ESBuildCSSMinifyPlugin.js +65 -0
  268. package/dist/plugins/ProgressPlugin.d.ts +15 -0
  269. package/dist/plugins/ProgressPlugin.js +44 -0
  270. package/dist/plugins/_SamplePlugin.d.ts +9 -0
  271. package/dist/plugins/_SamplePlugin.js +14 -0
  272. package/dist/requireHook.d.ts +1 -0
  273. package/dist/requireHook.js +31 -0
  274. package/dist/schema.d.ts +3 -0
  275. package/dist/schema.js +72 -0
  276. package/dist/server/server.d.ts +16 -0
  277. package/dist/server/server.js +158 -0
  278. package/dist/server/ws.d.ts +8 -0
  279. package/dist/server/ws.js +42 -0
  280. package/dist/swcPlugins/autoCSSModules.d.ts +8 -0
  281. package/dist/swcPlugins/autoCSSModules.js +35 -0
  282. package/dist/types.d.ts +100 -0
  283. package/dist/types.js +29 -0
  284. package/dist/utils/browsersList.d.ts +5 -0
  285. package/dist/utils/browsersList.js +10 -0
  286. package/dist/utils/depMatch.d.ts +6 -0
  287. package/dist/utils/depMatch.js +46 -0
  288. package/dist/utils/formatWebpackMessages.d.ts +12 -0
  289. package/dist/utils/formatWebpackMessages.js +100 -0
  290. package/package.json +170 -42
  291. package/bundled/css/hotModuleReplacement.js +0 -1203
  292. package/bundled/js/webpackHotDevClient.js +0 -13386
  293. package/lib/DevCompileDonePlugin.d.ts +0 -10
  294. package/lib/DevCompileDonePlugin.js +0 -53
  295. package/lib/cli.js +0 -184
  296. package/lib/getConfig/css.d.ts +0 -22
  297. package/lib/getConfig/css.js +0 -186
  298. package/lib/getConfig/getConfig.d.ts +0 -26
  299. package/lib/getConfig/getConfig.js +0 -578
  300. package/lib/getConfig/nodeModulesTransform.d.ts +0 -13
  301. package/lib/getConfig/nodeModulesTransform.js +0 -141
  302. package/lib/getConfig/pkgMatch.d.ts +0 -2
  303. package/lib/getConfig/pkgMatch.js +0 -58
  304. package/lib/getConfig/resolveDefine.d.ts +0 -5
  305. package/lib/getConfig/resolveDefine.js +0 -53
  306. package/lib/getConfig/runtimePublicPathEntry.d.ts +0 -1
  307. package/lib/getConfig/runtimePublicPathEntry.js +0 -3
  308. package/lib/getConfig/terserOptions.d.ts +0 -41
  309. package/lib/getConfig/terserOptions.js +0 -64
  310. package/lib/index.d.ts +0 -34
  311. package/lib/index.js +0 -314
  312. package/lib/requireHook.d.ts +0 -3
  313. package/lib/requireHook.js +0 -51
  314. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependency.js +0 -94
  315. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssDependencyTemplate.js +0 -26
  316. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssLoadingRuntimeModule.js +0 -93
  317. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModule.js +0 -164
  318. package/lib/webpack/plugins/mini-css-extract-plugin/src/CssModuleFactory.js +0 -32
  319. package/lib/webpack/plugins/mini-css-extract-plugin/src/cjs.js +0 -15
  320. package/lib/webpack/plugins/mini-css-extract-plugin/src/index.js +0 -542
  321. package/lib/webpack/plugins/mini-css-extract-plugin/src/loader.js +0 -319
  322. package/lib/webpack/plugins/mini-css-extract-plugin/src/utils.js +0 -97
  323. package/lib/webpack/plugins/mini-css-extract-plugin.d.ts +0 -1
  324. package/lib/webpack/plugins/mini-css-extract-plugin.js +0 -15
  325. package/lib/webpack/plugins/terser-webpack-plugin/package.json +0 -3
  326. package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack4Cache.js +0 -187
  327. package/lib/webpack/plugins/terser-webpack-plugin/src/Webpack5Cache.js +0 -61
  328. package/lib/webpack/plugins/terser-webpack-plugin/src/index.js +0 -683
  329. package/lib/webpack/plugins/terser-webpack-plugin/src/minify.js +0 -197
  330. package/lib/webpack/plugins/terser-webpack-plugin.d.ts +0 -1
  331. package/lib/webpack/plugins/terser-webpack-plugin.js +0 -15
  332. package/lib/webpackHotDevClient/formatWebpackMessages.d.ts +0 -11
  333. package/lib/webpackHotDevClient/formatWebpackMessages.js +0 -127
  334. package/lib/webpackHotDevClient/webpackHotDevClient.js +0 -311
@@ -1,319 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.pitch = pitch;
7
- exports.default = _default;
8
-
9
- function _react() {
10
- const data = _interopRequireDefault(require("react"));
11
-
12
- _react = function _react() {
13
- return data;
14
- };
15
-
16
- return data;
17
- }
18
-
19
- function _loaderUtils() {
20
- const data = _interopRequireDefault(require("@umijs/deps/compiled/loader-utils"));
21
-
22
- _loaderUtils = function _loaderUtils() {
23
- return data;
24
- };
25
-
26
- return data;
27
- }
28
-
29
- function _webpack() {
30
- const data = require("@umijs/deps/compiled/webpack");
31
-
32
- _webpack = function _webpack() {
33
- return data;
34
- };
35
-
36
- return data;
37
- }
38
-
39
- function _LibraryTemplatePlugin() {
40
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/LibraryTemplatePlugin"));
41
-
42
- _LibraryTemplatePlugin = function _LibraryTemplatePlugin() {
43
- return data;
44
- };
45
-
46
- return data;
47
- }
48
-
49
- function _LimitChunkCountPlugin() {
50
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/LimitChunkCountPlugin"));
51
-
52
- _LimitChunkCountPlugin = function _LimitChunkCountPlugin() {
53
- return data;
54
- };
55
-
56
- return data;
57
- }
58
-
59
- function _NodeTargetPlugin() {
60
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/NodeTargetPlugin"));
61
-
62
- _NodeTargetPlugin = function _NodeTargetPlugin() {
63
- return data;
64
- };
65
-
66
- return data;
67
- }
68
-
69
- function _NodeTemplatePlugin() {
70
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/NodeTemplatePlugin"));
71
-
72
- _NodeTemplatePlugin = function _NodeTemplatePlugin() {
73
- return data;
74
- };
75
-
76
- return data;
77
- }
78
-
79
- function _NormalModule() {
80
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/NormalModule"));
81
-
82
- _NormalModule = function _NormalModule() {
83
- return data;
84
- };
85
-
86
- return data;
87
- }
88
-
89
- function _SingleEntryPlugin() {
90
- const data = _interopRequireDefault(require("@umijs/deps/compiled/webpack/SingleEntryPlugin"));
91
-
92
- _SingleEntryPlugin = function _SingleEntryPlugin() {
93
- return data;
94
- };
95
-
96
- return data;
97
- }
98
-
99
- function _utils() {
100
- const data = require("@umijs/utils");
101
-
102
- _utils = function _utils() {
103
- return data;
104
- };
105
-
106
- return data;
107
- }
108
-
109
- function _path() {
110
- const data = _interopRequireDefault(require("path"));
111
-
112
- _path = function _path() {
113
- return data;
114
- };
115
-
116
- return data;
117
- }
118
-
119
- var _CssDependency = _interopRequireDefault(require("./CssDependency"));
120
-
121
- var _utils2 = require("./utils");
122
-
123
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
124
-
125
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
126
-
127
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
128
-
129
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
130
-
131
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
132
-
133
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
134
-
135
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
136
-
137
- const pluginName = 'mini-css-extract-plugin';
138
- const isWebpack4 = _webpack().version[0] === '4';
139
-
140
- function hotLoader(content, context) {
141
- const accept = context.locals ? '' : 'module.hot.accept(undefined, cssReload);';
142
- return `${content}
143
- if(module.hot) {
144
- // ${Date.now()}
145
- var cssReload = require(${_loaderUtils().default.stringifyRequest(context.context, (0, _utils().winPath)(_path().default.join(__dirname, '../../../../../bundled/css/hotModuleReplacement.js')))})(module.id, ${JSON.stringify(_objectSpread(_objectSpread({}, context.options), {}, {
146
- locals: !!context.locals
147
- }))});
148
- module.hot.dispose(cssReload);
149
- ${accept}
150
- }
151
- `;
152
- }
153
-
154
- function pitch(request) {
155
- const options = _loaderUtils().default.getOptions(this) || {};
156
- const loaders = this.loaders.slice(this.loaderIndex + 1);
157
- this.addDependency(this.resourcePath);
158
- const childFilename = '*';
159
- const publicPath = typeof options.publicPath === 'string' ? options.publicPath === '' || options.publicPath.endsWith('/') ? options.publicPath : `${options.publicPath}/` : typeof options.publicPath === 'function' ? options.publicPath(this.resourcePath, this.rootContext) : this._compilation.outputOptions.publicPath;
160
- const outputOptions = {
161
- filename: childFilename,
162
- publicPath
163
- };
164
-
165
- const childCompiler = this._compilation.createChildCompiler(`${pluginName} ${request}`, outputOptions);
166
-
167
- new (_NodeTemplatePlugin().default)(outputOptions).apply(childCompiler);
168
- new (_LibraryTemplatePlugin().default)(null, 'commonjs2').apply(childCompiler);
169
- new (_NodeTargetPlugin().default)().apply(childCompiler);
170
- new (_SingleEntryPlugin().default)(this.context, `!!${request}`, pluginName).apply(childCompiler);
171
- new (_LimitChunkCountPlugin().default)({
172
- maxChunks: 1
173
- }).apply(childCompiler);
174
- childCompiler.hooks.thisCompilation.tap(`${pluginName} loader`, compilation => {
175
- const normalModuleHook = typeof _NormalModule().default.getCompilationHooks !== 'undefined' ? _NormalModule().default.getCompilationHooks(compilation).loader : compilation.hooks.normalModuleLoader;
176
- normalModuleHook.tap(`${pluginName} loader`, (loaderContext, module) => {
177
- // eslint-disable-next-line no-param-reassign
178
- loaderContext.emitFile = this.emitFile;
179
-
180
- if (module.request === request) {
181
- // eslint-disable-next-line no-param-reassign
182
- module.loaders = loaders.map(loader => {
183
- return {
184
- loader: loader.path,
185
- options: loader.options,
186
- ident: loader.ident
187
- };
188
- });
189
- }
190
- });
191
- });
192
- let source;
193
-
194
- if (isWebpack4) {
195
- childCompiler.hooks.afterCompile.tap(pluginName, compilation => {
196
- source = compilation.assets[childFilename] && compilation.assets[childFilename].source(); // Remove all chunk assets
197
-
198
- compilation.chunks.forEach(chunk => {
199
- chunk.files.forEach(file => {
200
- delete compilation.assets[file]; // eslint-disable-line no-param-reassign
201
- });
202
- });
203
- });
204
- } else {
205
- childCompiler.hooks.compilation.tap(pluginName, compilation => {
206
- compilation.hooks.processAssets.tap(pluginName, () => {
207
- source = compilation.assets[childFilename] && compilation.assets[childFilename].source(); // Remove all chunk assets
208
-
209
- compilation.chunks.forEach(chunk => {
210
- chunk.files.forEach(file => {
211
- compilation.deleteAsset(file);
212
- });
213
- });
214
- });
215
- });
216
- }
217
-
218
- const callback = this.async();
219
- childCompiler.runAsChild((err, entries, compilation) => {
220
- const addDependencies = dependencies => {
221
- if (!Array.isArray(dependencies) && dependencies != null) {
222
- throw new Error(`Exported value was not extracted as an array: ${JSON.stringify(dependencies)}`);
223
- }
224
-
225
- const identifierCountMap = new Map();
226
-
227
- var _iterator = _createForOfIteratorHelper(dependencies),
228
- _step;
229
-
230
- try {
231
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
232
- const dependency = _step.value;
233
- const count = identifierCountMap.get(dependency.identifier) || 0;
234
-
235
- this._module.addDependency(new _CssDependency.default(dependency, dependency.context, count));
236
-
237
- identifierCountMap.set(dependency.identifier, count + 1);
238
- }
239
- } catch (err) {
240
- _iterator.e(err);
241
- } finally {
242
- _iterator.f();
243
- }
244
- };
245
-
246
- if (err) {
247
- return callback(err);
248
- }
249
-
250
- if (compilation.errors.length > 0) {
251
- return callback(compilation.errors[0]);
252
- }
253
-
254
- compilation.fileDependencies.forEach(dep => {
255
- this.addDependency(dep);
256
- }, this);
257
- compilation.contextDependencies.forEach(dep => {
258
- this.addContextDependency(dep);
259
- }, this);
260
-
261
- if (!source) {
262
- return callback(new Error("Didn't get a result from child compiler"));
263
- }
264
-
265
- let locals;
266
- const esModule = typeof options.esModule !== 'undefined' ? options.esModule : false;
267
- const namedExport = esModule && options.modules && options.modules.namedExport;
268
-
269
- try {
270
- const originalExports = (0, _utils2.evalModuleCode)(this, source, request); // eslint-disable-next-line no-underscore-dangle
271
-
272
- exports = originalExports.__esModule ? originalExports.default : originalExports;
273
-
274
- if (namedExport) {
275
- Object.keys(originalExports).forEach(key => {
276
- if (key !== 'default') {
277
- if (!locals) locals = {};
278
- locals[key] = originalExports[key];
279
- }
280
- });
281
- } else {
282
- locals = exports && exports.locals;
283
- }
284
-
285
- let dependencies;
286
-
287
- if (!Array.isArray(exports)) {
288
- dependencies = [[null, exports]];
289
- } else {
290
- dependencies = exports.map(([id, content, media, sourceMap]) => {
291
- const module = (0, _utils2.findModuleById)(compilation, id);
292
- return {
293
- identifier: module.identifier(),
294
- context: module.context,
295
- content,
296
- media,
297
- sourceMap
298
- };
299
- });
300
- }
301
-
302
- addDependencies(dependencies);
303
- } catch (e) {
304
- return callback(e);
305
- }
306
-
307
- const result = locals ? namedExport ? Object.keys(locals).map(key => `\nexport const ${key} = ${JSON.stringify(locals[key])};`).join('') : `\n${esModule ? 'export default' : 'module.exports ='} ${JSON.stringify(locals)};` : esModule ? `\nexport {};` : '';
308
- let resultSource = `// extracted by ${pluginName}`;
309
- resultSource += options.hmr ? hotLoader(result, {
310
- context: this.context,
311
- options,
312
- locals
313
- }) : result;
314
- return callback(null, resultSource);
315
- });
316
- } // eslint-disable-next-line func-names
317
-
318
-
319
- function _default() {}
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.findModuleById = findModuleById;
7
- exports.evalModuleCode = evalModuleCode;
8
- exports.compareModulesByIdentifier = compareModulesByIdentifier;
9
- exports.MODULE_TYPE = void 0;
10
-
11
- function _react() {
12
- const data = _interopRequireDefault(require("react"));
13
-
14
- _react = function _react() {
15
- return data;
16
- };
17
-
18
- return data;
19
- }
20
-
21
- function _module() {
22
- const data = _interopRequireDefault(require("module"));
23
-
24
- _module = function _module() {
25
- return data;
26
- };
27
-
28
- return data;
29
- }
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
-
33
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
34
-
35
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
36
-
37
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
38
-
39
- const MODULE_TYPE = 'css/mini-extract';
40
- exports.MODULE_TYPE = MODULE_TYPE;
41
-
42
- function findModuleById(compilation, id) {
43
- const modules = compilation.modules,
44
- chunkGraph = compilation.chunkGraph;
45
-
46
- var _iterator = _createForOfIteratorHelper(modules),
47
- _step;
48
-
49
- try {
50
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
51
- const module = _step.value;
52
- const moduleId = typeof chunkGraph !== 'undefined' ? chunkGraph.getModuleId(module) : module.id;
53
-
54
- if (moduleId === id) {
55
- return module;
56
- }
57
- }
58
- } catch (err) {
59
- _iterator.e(err);
60
- } finally {
61
- _iterator.f();
62
- }
63
-
64
- return null;
65
- }
66
-
67
- function evalModuleCode(loaderContext, code, filename) {
68
- const module = new (_module().default)(filename, loaderContext);
69
- module.paths = _module().default._nodeModulePaths(loaderContext.context); // eslint-disable-line no-underscore-dangle
70
-
71
- module.filename = filename;
72
-
73
- module._compile(code, filename); // eslint-disable-line no-underscore-dangle
74
-
75
-
76
- return module.exports;
77
- }
78
-
79
- function compareIds(a, b) {
80
- if (typeof a !== typeof b) {
81
- return typeof a < typeof b ? -1 : 1;
82
- }
83
-
84
- if (a < b) {
85
- return -1;
86
- }
87
-
88
- if (a > b) {
89
- return 1;
90
- }
91
-
92
- return 0;
93
- }
94
-
95
- function compareModulesByIdentifier(a, b) {
96
- return compareIds(a.identifier(), b.identifier());
97
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- function _react() {
4
- const data = _interopRequireDefault(require("react"));
5
-
6
- _react = function _react() {
7
- return data;
8
- };
9
-
10
- return data;
11
- }
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- module.exports = require('./mini-css-extract-plugin/src').default;
@@ -1,3 +0,0 @@
1
- {
2
- "version": "4.2.3"
3
- }
@@ -1,187 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- function _react() {
9
- const data = _interopRequireDefault(require("react"));
10
-
11
- _react = function _react() {
12
- return data;
13
- };
14
-
15
- return data;
16
- }
17
-
18
- function _os() {
19
- const data = _interopRequireDefault(require("os"));
20
-
21
- _os = function _os() {
22
- return data;
23
- };
24
-
25
- return data;
26
- }
27
-
28
- function _cacache() {
29
- const data = _interopRequireDefault(require("@umijs/deps/compiled/cacache"));
30
-
31
- _cacache = function _cacache() {
32
- return data;
33
- };
34
-
35
- return data;
36
- }
37
-
38
- function _findCacheDir() {
39
- const data = _interopRequireDefault(require("@umijs/deps/compiled/find-cache-dir"));
40
-
41
- _findCacheDir = function _findCacheDir() {
42
- return data;
43
- };
44
-
45
- return data;
46
- }
47
-
48
- function _serializeJavascript() {
49
- const data = _interopRequireDefault(require("@umijs/deps/compiled/serialize-javascript"));
50
-
51
- _serializeJavascript = function _serializeJavascript() {
52
- return data;
53
- };
54
-
55
- return data;
56
- }
57
-
58
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59
-
60
- 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); } }
61
-
62
- 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); }); }; }
63
-
64
- class Webpack4Cache {
65
- constructor(compilation, options, weakCache) {
66
- this.cache = options.cache === true ? Webpack4Cache.getCacheDirectory() : options.cache;
67
- this.weakCache = weakCache;
68
- }
69
-
70
- static getCacheDirectory() {
71
- return (0, _findCacheDir().default)({
72
- name: 'terser-webpack-plugin'
73
- }) || _os().default.tmpdir();
74
- }
75
-
76
- get(cacheData, {
77
- RawSource,
78
- ConcatSource,
79
- SourceMapSource
80
- }) {
81
- var _this = this;
82
-
83
- return _asyncToGenerator(function* () {
84
- if (!_this.cache) {
85
- // eslint-disable-next-line no-undefined
86
- return undefined;
87
- }
88
-
89
- const weakOutput = _this.weakCache.get(cacheData.inputSource);
90
-
91
- if (weakOutput) {
92
- return weakOutput;
93
- } // eslint-disable-next-line no-param-reassign
94
-
95
-
96
- cacheData.cacheIdent = cacheData.cacheIdent || (0, _serializeJavascript().default)(cacheData.cacheKeys);
97
- let cachedResult;
98
-
99
- try {
100
- cachedResult = yield _cacache().default.get(_this.cache, cacheData.cacheIdent);
101
- } catch (ignoreError) {
102
- // eslint-disable-next-line no-undefined
103
- return undefined;
104
- }
105
-
106
- cachedResult = JSON.parse(cachedResult.data);
107
-
108
- if (cachedResult.target === 'comments') {
109
- return new ConcatSource(cachedResult.value);
110
- }
111
-
112
- const _cachedResult = cachedResult,
113
- code = _cachedResult.code,
114
- name = _cachedResult.name,
115
- map = _cachedResult.map,
116
- input = _cachedResult.input,
117
- inputSourceMap = _cachedResult.inputSourceMap,
118
- extractedComments = _cachedResult.extractedComments,
119
- banner = _cachedResult.banner,
120
- shebang = _cachedResult.shebang;
121
-
122
- if (map) {
123
- cachedResult.source = new SourceMapSource(code, name, map, input, inputSourceMap, true);
124
- } else {
125
- cachedResult.source = new RawSource(code);
126
- }
127
-
128
- if (banner) {
129
- cachedResult.source = new ConcatSource(shebang ? `${shebang}\n` : '', `/*! ${banner} */\n`, cachedResult.source);
130
- }
131
-
132
- if (extractedComments) {
133
- cachedResult.extractedCommentsSource = new RawSource(extractedComments);
134
- }
135
-
136
- return cachedResult;
137
- })();
138
- }
139
-
140
- store(cacheData) {
141
- var _this2 = this;
142
-
143
- return _asyncToGenerator(function* () {
144
- if (!_this2.cache) {
145
- // eslint-disable-next-line no-undefined
146
- return undefined;
147
- }
148
-
149
- if (!_this2.weakCache.has(cacheData.inputSource)) {
150
- if (cacheData.target === 'comments') {
151
- _this2.weakCache.set(cacheData.inputSource, cacheData.output);
152
- } else {
153
- _this2.weakCache.set(cacheData.inputSource, cacheData);
154
- }
155
- }
156
-
157
- let data;
158
-
159
- if (cacheData.target === 'comments') {
160
- data = {
161
- target: cacheData.target,
162
- value: cacheData.output.source()
163
- };
164
- } else {
165
- data = {
166
- code: cacheData.code,
167
- name: cacheData.name,
168
- map: cacheData.map,
169
- input: cacheData.input,
170
- inputSourceMap: cacheData.inputSourceMap,
171
- banner: cacheData.banner,
172
- shebang: cacheData.shebang
173
- };
174
-
175
- if (cacheData.extractedCommentsSource) {
176
- data.extractedComments = cacheData.extractedCommentsSource.source();
177
- data.commentsFilename = cacheData.commentsFilename;
178
- }
179
- }
180
-
181
- return _cacache().default.put(_this2.cache, cacheData.cacheIdent, JSON.stringify(data));
182
- })();
183
- }
184
-
185
- }
186
-
187
- exports.default = Webpack4Cache;
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- function _react() {
9
- const data = _interopRequireDefault(require("react"));
10
-
11
- _react = function _react() {
12
- return data;
13
- };
14
-
15
- return data;
16
- }
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- 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); } }
21
-
22
- 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); }); }; }
23
-
24
- class Cache {
25
- constructor(compilation) {
26
- this.cache = compilation.getCache('TerserWebpackPlugin');
27
- }
28
-
29
- get(cacheData) {
30
- var _this = this;
31
-
32
- return _asyncToGenerator(function* () {
33
- // eslint-disable-next-line no-param-reassign
34
- cacheData.eTag = cacheData.eTag || Array.isArray(cacheData.inputSource) ? cacheData.inputSource.map(item => _this.cache.getLazyHashedEtag(item)).reduce((previousValue, currentValue) => _this.cache.mergeEtags(previousValue, currentValue)) : _this.cache.getLazyHashedEtag(cacheData.inputSource);
35
- return _this.cache.getPromise(cacheData.name, cacheData.eTag);
36
- })();
37
- }
38
-
39
- store(cacheData) {
40
- var _this2 = this;
41
-
42
- return _asyncToGenerator(function* () {
43
- let data;
44
-
45
- if (cacheData.target === 'comments') {
46
- data = cacheData.output;
47
- } else {
48
- data = {
49
- source: cacheData.source,
50
- extractedCommentsSource: cacheData.extractedCommentsSource,
51
- commentsFilename: cacheData.commentsFilename
52
- };
53
- }
54
-
55
- return _this2.cache.storePromise(cacheData.name, cacheData.eTag, data);
56
- })();
57
- }
58
-
59
- }
60
-
61
- exports.default = Cache;