@rsdoctor/core 1.2.3 → 1.2.4-beta.1

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 (311) hide show
  1. package/dist/build-utils/{common/trans-utils/transStats.js → build/chunks/assetsModules.cjs} +9 -12
  2. package/dist/build-utils/build/chunks/assetsModules.d.ts +0 -1
  3. package/dist/build-utils/build/chunks/assetsModules.js +7 -39
  4. package/dist/build-utils/build/chunks/chunkTransform.cjs +39 -0
  5. package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -1
  6. package/dist/build-utils/build/chunks/chunkTransform.js +5 -37
  7. package/dist/build-utils/{common/chunks/index.js → build/chunks/index.cjs} +8 -8
  8. package/dist/build-utils/build/chunks/index.d.ts +0 -1
  9. package/dist/build-utils/build/chunks/index.js +5 -78
  10. package/dist/build-utils/build/chunks/rspack/transform.cjs +80 -0
  11. package/dist/build-utils/build/chunks/rspack/transform.d.ts +0 -1
  12. package/dist/build-utils/build/chunks/rspack/transform.js +7 -42
  13. package/dist/build-utils/{common/index.js → build/index.cjs} +14 -14
  14. package/dist/build-utils/build/index.d.ts +0 -1
  15. package/dist/build-utils/build/index.js +8 -52
  16. package/dist/build-utils/build/loader/index.cjs +69 -0
  17. package/dist/build-utils/build/loader/index.d.ts +1 -1
  18. package/dist/build-utils/build/loader/index.js +4 -60
  19. package/dist/build-utils/build/loader/probeLoader.cjs +90 -0
  20. package/dist/build-utils/build/loader/probeLoader.d.ts +0 -1
  21. package/dist/build-utils/build/loader/probeLoader.js +12 -57
  22. package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +65 -0
  23. package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +0 -1
  24. package/dist/build-utils/build/loader/probeLoaderPlugin.js +11 -43
  25. package/dist/build-utils/build/module-graph/index.cjs +87 -0
  26. package/dist/build-utils/build/module-graph/index.d.ts +0 -1
  27. package/dist/build-utils/build/module-graph/index.js +6 -87
  28. package/dist/build-utils/build/module-graph/parser.cjs +46 -0
  29. package/dist/build-utils/build/module-graph/parser.d.ts +0 -1
  30. package/dist/build-utils/build/module-graph/parser.js +7 -39
  31. package/dist/build-utils/build/module-graph/rspack/transform.cjs +110 -0
  32. package/dist/build-utils/build/module-graph/rspack/transform.d.ts +0 -1
  33. package/dist/build-utils/build/module-graph/rspack/transform.js +12 -50
  34. package/dist/build-utils/build/module-graph/transform.cjs +40 -0
  35. package/dist/build-utils/build/module-graph/transform.d.ts +0 -1
  36. package/dist/build-utils/build/module-graph/transform.js +6 -38
  37. package/dist/build-utils/build/module-graph/treeShaking.cjs +107 -0
  38. package/dist/build-utils/build/module-graph/treeShaking.d.ts +0 -1
  39. package/dist/build-utils/build/module-graph/treeShaking.js +15 -49
  40. package/dist/build-utils/build/module-graph/utils.cjs +97 -0
  41. package/dist/build-utils/build/module-graph/utils.d.ts +0 -1
  42. package/dist/build-utils/build/module-graph/utils.js +15 -50
  43. package/dist/build-utils/build/module-graph/webpack/transform.cjs +171 -0
  44. package/dist/build-utils/build/module-graph/webpack/transform.d.ts +0 -1
  45. package/dist/build-utils/build/module-graph/webpack/transform.js +31 -57
  46. package/dist/build-utils/{common/module-graph/index.js → build/utils/index.cjs} +15 -15
  47. package/dist/build-utils/build/utils/index.d.ts +0 -2
  48. package/dist/build-utils/build/utils/index.js +5 -87
  49. package/dist/build-utils/build/utils/loader.cjs +356 -0
  50. package/dist/build-utils/build/utils/loader.d.ts +1 -3
  51. package/dist/build-utils/build/utils/loader.js +44 -90
  52. package/dist/build-utils/build/utils/parseBundle.cjs +284 -0
  53. package/dist/build-utils/build/utils/parseBundle.d.ts +1 -2
  54. package/dist/build-utils/build/utils/parseBundle.js +19 -61
  55. package/dist/build-utils/build/utils/plugin.cjs +61 -0
  56. package/dist/build-utils/build/utils/plugin.d.ts +0 -1
  57. package/dist/build-utils/build/utils/plugin.js +5 -43
  58. package/dist/build-utils/index.cjs +36 -0
  59. package/dist/build-utils/index.d.ts +0 -2
  60. package/dist/build-utils/index.js +4 -40
  61. package/dist/index.cjs +85 -0
  62. package/dist/index.d.ts +0 -1
  63. package/dist/index.js +6 -85
  64. package/dist/inner-plugins/constants.cjs +64 -0
  65. package/dist/inner-plugins/constants.d.ts +0 -1
  66. package/dist/inner-plugins/constants.js +3 -47
  67. package/dist/{build-utils/common/trans-utils/index.js → inner-plugins/index.cjs} +14 -5
  68. package/dist/inner-plugins/index.d.ts +0 -1
  69. package/dist/inner-plugins/index.js +4 -69
  70. package/dist/inner-plugins/loaders/proxy.cjs +90 -0
  71. package/dist/inner-plugins/loaders/proxy.d.ts +4 -2
  72. package/dist/inner-plugins/loaders/proxy.js +19 -22
  73. package/dist/inner-plugins/plugins/base.cjs +53 -0
  74. package/dist/inner-plugins/plugins/base.d.ts +3 -5
  75. package/dist/inner-plugins/plugins/base.js +6 -38
  76. package/dist/inner-plugins/plugins/bundle.cjs +121 -0
  77. package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
  78. package/dist/inner-plugins/plugins/bundle.js +33 -49
  79. package/dist/inner-plugins/plugins/bundleTagPlugin.cjs +93 -0
  80. package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +0 -1
  81. package/dist/inner-plugins/plugins/bundleTagPlugin.js +12 -44
  82. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +166 -0
  83. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +0 -1
  84. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +42 -70
  85. package/dist/inner-plugins/plugins/errors.cjs +98 -0
  86. package/dist/inner-plugins/plugins/errors.d.ts +0 -1
  87. package/dist/inner-plugins/plugins/errors.js +20 -52
  88. package/dist/inner-plugins/plugins/index.cjs +141 -0
  89. package/dist/inner-plugins/plugins/index.d.ts +0 -1
  90. package/dist/inner-plugins/plugins/index.js +12 -141
  91. package/dist/inner-plugins/plugins/loader.cjs +155 -0
  92. package/dist/inner-plugins/plugins/loader.d.ts +0 -1
  93. package/dist/inner-plugins/plugins/loader.js +29 -57
  94. package/dist/inner-plugins/plugins/plugins.cjs +73 -0
  95. package/dist/inner-plugins/plugins/plugins.d.ts +0 -1
  96. package/dist/inner-plugins/plugins/plugins.js +18 -50
  97. package/dist/inner-plugins/plugins/progress.cjs +70 -0
  98. package/dist/inner-plugins/plugins/progress.d.ts +0 -1
  99. package/dist/inner-plugins/plugins/progress.js +9 -41
  100. package/dist/inner-plugins/plugins/rspack.cjs +117 -0
  101. package/dist/inner-plugins/plugins/rspack.d.ts +0 -1
  102. package/dist/inner-plugins/plugins/rspack.js +24 -56
  103. package/dist/inner-plugins/plugins/rules.cjs +97 -0
  104. package/dist/inner-plugins/plugins/rules.d.ts +0 -1
  105. package/dist/inner-plugins/plugins/rules.js +19 -51
  106. package/dist/inner-plugins/plugins/sourcemapTool.cjs +213 -0
  107. package/dist/inner-plugins/plugins/sourcemapTool.d.ts +0 -1
  108. package/dist/inner-plugins/plugins/sourcemapTool.js +23 -67
  109. package/dist/inner-plugins/plugins/summary.cjs +125 -0
  110. package/dist/inner-plugins/plugins/summary.d.ts +0 -1
  111. package/dist/inner-plugins/plugins/summary.js +28 -60
  112. package/dist/inner-plugins/utils/circleDetect.cjs +49 -0
  113. package/dist/inner-plugins/utils/circleDetect.d.ts +0 -1
  114. package/dist/inner-plugins/utils/circleDetect.js +3 -35
  115. package/dist/inner-plugins/utils/config.cjs +177 -0
  116. package/dist/inner-plugins/utils/config.d.ts +3 -8
  117. package/dist/inner-plugins/utils/config.js +43 -116
  118. package/dist/inner-plugins/utils/index.cjs +124 -0
  119. package/dist/inner-plugins/utils/index.d.ts +4 -1
  120. package/dist/inner-plugins/utils/index.js +9 -96
  121. package/dist/inner-plugins/utils/loader.cjs +231 -0
  122. package/dist/inner-plugins/utils/loader.d.ts +4 -4
  123. package/dist/inner-plugins/utils/loader.js +39 -97
  124. package/dist/inner-plugins/utils/normalize-config.cjs +122 -0
  125. package/dist/inner-plugins/utils/normalize-config.d.ts +40 -0
  126. package/dist/inner-plugins/utils/normalize-config.js +78 -0
  127. package/dist/inner-plugins/utils/plugin-common.cjs +73 -0
  128. package/dist/inner-plugins/utils/plugin-common.d.ts +6 -0
  129. package/dist/inner-plugins/utils/plugin-common.js +28 -0
  130. package/dist/inner-plugins/utils/plugin.cjs +107 -0
  131. package/dist/inner-plugins/utils/plugin.d.ts +2 -4
  132. package/dist/inner-plugins/utils/plugin.js +5 -40
  133. package/dist/inner-plugins/utils/sdk.cjs +55 -0
  134. package/dist/inner-plugins/utils/sdk.d.ts +8 -4
  135. package/dist/inner-plugins/utils/sdk.js +9 -42
  136. package/dist/rules/index.cjs +85 -0
  137. package/dist/rules/index.d.ts +0 -1
  138. package/dist/rules/index.js +6 -85
  139. package/dist/rules/linter.cjs +71 -0
  140. package/dist/rules/linter.d.ts +0 -1
  141. package/dist/rules/linter.js +11 -46
  142. package/dist/rules/rule.cjs +137 -0
  143. package/dist/rules/rule.d.ts +1 -2
  144. package/dist/rules/rule.js +20 -55
  145. package/dist/rules/rules/cross-chunks-package/index.cjs +73 -0
  146. package/dist/rules/rules/cross-chunks-package/index.d.ts +0 -1
  147. package/dist/rules/rules/cross-chunks-package/index.js +10 -42
  148. package/dist/rules/rules/cross-chunks-package/types.d.ts +0 -1
  149. package/dist/rules/rules/cross-chunks-package/types.js +2 -18
  150. package/dist/rules/rules/cross-chunks-package/utils.cjs +40 -0
  151. package/dist/rules/rules/cross-chunks-package/utils.d.ts +1 -2
  152. package/dist/rules/rules/cross-chunks-package/utils.js +4 -36
  153. package/dist/rules/rules/default-import-check/index.cjs +116 -0
  154. package/dist/rules/rules/default-import-check/index.d.ts +0 -1
  155. package/dist/rules/rules/default-import-check/index.js +17 -49
  156. package/dist/rules/rules/default-import-check/types.cjs +18 -0
  157. package/dist/rules/rules/default-import-check/types.d.ts +0 -1
  158. package/dist/rules/rules/default-import-check/types.js +2 -18
  159. package/dist/rules/rules/default-import-check/utils.cjs +98 -0
  160. package/dist/rules/rules/default-import-check/utils.d.ts +0 -1
  161. package/dist/rules/rules/default-import-check/utils.js +9 -53
  162. package/dist/rules/rules/duplicate-package/index.cjs +71 -0
  163. package/dist/rules/rules/duplicate-package/index.d.ts +0 -1
  164. package/dist/rules/rules/duplicate-package/index.js +15 -47
  165. package/dist/rules/rules/duplicate-package/types.cjs +60 -0
  166. package/dist/rules/rules/duplicate-package/types.d.ts +0 -1
  167. package/dist/rules/rules/duplicate-package/types.js +5 -40
  168. package/dist/rules/rules/duplicate-package/utils.cjs +84 -0
  169. package/dist/rules/rules/duplicate-package/utils.d.ts +0 -1
  170. package/dist/rules/rules/duplicate-package/utils.js +6 -51
  171. package/dist/rules/rules/ecma-version-check/index.cjs +97 -0
  172. package/dist/rules/rules/ecma-version-check/index.d.ts +0 -1
  173. package/dist/rules/rules/ecma-version-check/index.js +16 -58
  174. package/dist/rules/rules/ecma-version-check/types.cjs +18 -0
  175. package/dist/rules/rules/ecma-version-check/types.d.ts +0 -1
  176. package/dist/rules/rules/ecma-version-check/types.js +2 -18
  177. package/dist/rules/rules/ecma-version-check/utils.cjs +39 -0
  178. package/dist/rules/rules/ecma-version-check/utils.d.ts +0 -1
  179. package/dist/rules/rules/ecma-version-check/utils.js +3 -35
  180. package/dist/rules/rules/index.cjs +47 -0
  181. package/dist/rules/rules/index.d.ts +0 -1
  182. package/dist/rules/rules/index.js +13 -45
  183. package/dist/rules/rules/loader-performance-optimization/index.cjs +119 -0
  184. package/dist/rules/rules/loader-performance-optimization/index.d.ts +0 -1
  185. package/dist/rules/rules/loader-performance-optimization/index.js +14 -46
  186. package/dist/rules/rules/loader-performance-optimization/types.cjs +18 -0
  187. package/dist/rules/rules/loader-performance-optimization/types.d.ts +0 -1
  188. package/dist/rules/rules/loader-performance-optimization/types.js +2 -18
  189. package/dist/{build-utils/common/chunks/assetsContent.js → rules/rules/loader-performance-optimization/utils.cjs} +9 -10
  190. package/dist/rules/rules/loader-performance-optimization/utils.d.ts +0 -1
  191. package/dist/rules/rules/loader-performance-optimization/utils.js +3 -35
  192. package/dist/rules/utils.cjs +46 -0
  193. package/dist/rules/utils.d.ts +0 -1
  194. package/dist/rules/utils.js +6 -41
  195. package/dist/types/chunks.cjs +18 -0
  196. package/dist/types/chunks.d.ts +1 -7
  197. package/dist/types/chunks.js +2 -18
  198. package/dist/types/index.cjs +87 -0
  199. package/dist/types/index.d.ts +0 -2
  200. package/dist/types/index.js +6 -96
  201. package/dist/types/loader.cjs +18 -0
  202. package/dist/types/loader.d.ts +0 -1
  203. package/dist/types/loader.js +2 -18
  204. package/dist/types/plugin.cjs +18 -0
  205. package/dist/types/plugin.d.ts +7 -108
  206. package/dist/types/plugin.js +2 -18
  207. package/dist/types/rules.cjs +18 -0
  208. package/dist/types/rules.d.ts +0 -1
  209. package/dist/types/rules.js +2 -18
  210. package/package.json +33 -34
  211. package/dist/build-utils/build/chunks/assetsModules.d.ts.map +0 -1
  212. package/dist/build-utils/build/chunks/chunkTransform.d.ts.map +0 -1
  213. package/dist/build-utils/build/chunks/index.d.ts.map +0 -1
  214. package/dist/build-utils/build/chunks/rspack/transform.d.ts.map +0 -1
  215. package/dist/build-utils/build/index.d.ts.map +0 -1
  216. package/dist/build-utils/build/loader/index.d.ts.map +0 -1
  217. package/dist/build-utils/build/loader/probeLoader.d.ts.map +0 -1
  218. package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts.map +0 -1
  219. package/dist/build-utils/build/module-graph/index.d.ts.map +0 -1
  220. package/dist/build-utils/build/module-graph/parser.d.ts.map +0 -1
  221. package/dist/build-utils/build/module-graph/rspack/transform.d.ts.map +0 -1
  222. package/dist/build-utils/build/module-graph/transform.d.ts.map +0 -1
  223. package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +0 -1
  224. package/dist/build-utils/build/module-graph/utils.d.ts.map +0 -1
  225. package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +0 -1
  226. package/dist/build-utils/build/utils/index.d.ts.map +0 -1
  227. package/dist/build-utils/build/utils/loader.d.ts.map +0 -1
  228. package/dist/build-utils/build/utils/parseBundle.d.ts.map +0 -1
  229. package/dist/build-utils/build/utils/plugin.d.ts.map +0 -1
  230. package/dist/build-utils/common/chunks/assetsContent.d.ts +0 -6
  231. package/dist/build-utils/common/chunks/assetsContent.d.ts.map +0 -1
  232. package/dist/build-utils/common/chunks/assetsModules.d.ts +0 -23
  233. package/dist/build-utils/common/chunks/assetsModules.d.ts.map +0 -1
  234. package/dist/build-utils/common/chunks/assetsModules.js +0 -155
  235. package/dist/build-utils/common/chunks/chunkTransform.d.ts +0 -6
  236. package/dist/build-utils/common/chunks/chunkTransform.d.ts.map +0 -1
  237. package/dist/build-utils/common/chunks/chunkTransform.js +0 -74
  238. package/dist/build-utils/common/chunks/index.d.ts +0 -4
  239. package/dist/build-utils/common/chunks/index.d.ts.map +0 -1
  240. package/dist/build-utils/common/index.d.ts +0 -6
  241. package/dist/build-utils/common/index.d.ts.map +0 -1
  242. package/dist/build-utils/common/module-graph/compatible.d.ts +0 -9
  243. package/dist/build-utils/common/module-graph/compatible.d.ts.map +0 -1
  244. package/dist/build-utils/common/module-graph/compatible.js +0 -73
  245. package/dist/build-utils/common/module-graph/index.d.ts +0 -4
  246. package/dist/build-utils/common/module-graph/index.d.ts.map +0 -1
  247. package/dist/build-utils/common/module-graph/transform.d.ts +0 -8
  248. package/dist/build-utils/common/module-graph/transform.d.ts.map +0 -1
  249. package/dist/build-utils/common/module-graph/transform.js +0 -181
  250. package/dist/build-utils/common/module-graph/utils.d.ts +0 -14
  251. package/dist/build-utils/common/module-graph/utils.d.ts.map +0 -1
  252. package/dist/build-utils/common/module-graph/utils.js +0 -58
  253. package/dist/build-utils/common/trans-utils/index.d.ts +0 -2
  254. package/dist/build-utils/common/trans-utils/index.d.ts.map +0 -1
  255. package/dist/build-utils/common/trans-utils/transStats.d.ts +0 -11
  256. package/dist/build-utils/common/trans-utils/transStats.d.ts.map +0 -1
  257. package/dist/build-utils/common/webpack/compatible.d.ts +0 -18
  258. package/dist/build-utils/common/webpack/compatible.d.ts.map +0 -1
  259. package/dist/build-utils/common/webpack/compatible.js +0 -156
  260. package/dist/build-utils/index.d.ts.map +0 -1
  261. package/dist/index.d.ts.map +0 -1
  262. package/dist/inner-plugins/constants.d.ts.map +0 -1
  263. package/dist/inner-plugins/index.d.ts.map +0 -1
  264. package/dist/inner-plugins/loaders/proxy.d.ts.map +0 -1
  265. package/dist/inner-plugins/plugins/base.d.ts.map +0 -1
  266. package/dist/inner-plugins/plugins/bundle.d.ts.map +0 -1
  267. package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts.map +0 -1
  268. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +0 -1
  269. package/dist/inner-plugins/plugins/errors.d.ts.map +0 -1
  270. package/dist/inner-plugins/plugins/index.d.ts.map +0 -1
  271. package/dist/inner-plugins/plugins/loader.d.ts.map +0 -1
  272. package/dist/inner-plugins/plugins/plugins.d.ts.map +0 -1
  273. package/dist/inner-plugins/plugins/progress.d.ts.map +0 -1
  274. package/dist/inner-plugins/plugins/rspack.d.ts.map +0 -1
  275. package/dist/inner-plugins/plugins/rules.d.ts.map +0 -1
  276. package/dist/inner-plugins/plugins/sourcemapTool.d.ts.map +0 -1
  277. package/dist/inner-plugins/plugins/summary.d.ts.map +0 -1
  278. package/dist/inner-plugins/utils/circleDetect.d.ts.map +0 -1
  279. package/dist/inner-plugins/utils/config.d.ts.map +0 -1
  280. package/dist/inner-plugins/utils/index.d.ts.map +0 -1
  281. package/dist/inner-plugins/utils/loader.d.ts.map +0 -1
  282. package/dist/inner-plugins/utils/plugin.d.ts.map +0 -1
  283. package/dist/inner-plugins/utils/sdk.d.ts.map +0 -1
  284. package/dist/rules/index.d.ts.map +0 -1
  285. package/dist/rules/linter.d.ts.map +0 -1
  286. package/dist/rules/rule.d.ts.map +0 -1
  287. package/dist/rules/rules/cross-chunks-package/index.d.ts.map +0 -1
  288. package/dist/rules/rules/cross-chunks-package/types.d.ts.map +0 -1
  289. package/dist/rules/rules/cross-chunks-package/utils.d.ts.map +0 -1
  290. package/dist/rules/rules/default-import-check/index.d.ts.map +0 -1
  291. package/dist/rules/rules/default-import-check/types.d.ts.map +0 -1
  292. package/dist/rules/rules/default-import-check/utils.d.ts.map +0 -1
  293. package/dist/rules/rules/duplicate-package/index.d.ts.map +0 -1
  294. package/dist/rules/rules/duplicate-package/types.d.ts.map +0 -1
  295. package/dist/rules/rules/duplicate-package/utils.d.ts.map +0 -1
  296. package/dist/rules/rules/ecma-version-check/index.d.ts.map +0 -1
  297. package/dist/rules/rules/ecma-version-check/types.d.ts.map +0 -1
  298. package/dist/rules/rules/ecma-version-check/utils.d.ts.map +0 -1
  299. package/dist/rules/rules/index.d.ts.map +0 -1
  300. package/dist/rules/rules/loader-performance-optimization/index.d.ts.map +0 -1
  301. package/dist/rules/rules/loader-performance-optimization/types.d.ts.map +0 -1
  302. package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +0 -1
  303. package/dist/rules/utils.d.ts.map +0 -1
  304. package/dist/types/chunks.d.ts.map +0 -1
  305. package/dist/types/index.d.ts.map +0 -1
  306. package/dist/types/loader.d.ts.map +0 -1
  307. package/dist/types/plugin.d.ts.map +0 -1
  308. package/dist/types/rules.d.ts.map +0 -1
  309. package/dist/types/webpack.d.ts +0 -15
  310. package/dist/types/webpack.d.ts.map +0 -1
  311. /package/dist/{types/webpack.js → rules/rules/cross-chunks-package/types.cjs} +0 -0
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ calculateNamespaceAndRegex: ()=>calculateNamespaceAndRegex,
28
+ ensureDevtools: ()=>ensureDevtools,
29
+ ensureModulesChunksGraphFn: ()=>ensureModulesChunksGraphFn
30
+ });
31
+ const types_namespaceObject = require("@rsdoctor/types");
32
+ const build_namespaceObject = require("@rsdoctor/utils/build");
33
+ const logger_namespaceObject = require("@rsdoctor/utils/logger");
34
+ const index_cjs_namespaceObject = require("../../build-utils/build/index.cjs");
35
+ const external_constants_cjs_namespaceObject = require("../constants.cjs");
36
+ const external_rspack_cjs_namespaceObject = require("./rspack.cjs");
37
+ const external_sourcemapTool_cjs_namespaceObject = require("./sourcemapTool.cjs");
38
+ let hasConsole = false;
39
+ const ensureModulesChunksGraphFn = (compiler, _this)=>{
40
+ var _compiler_webpack_experiments;
41
+ if (_this._modulesGraphApplied) return;
42
+ _this._modulesGraphApplied = true;
43
+ const context = {
44
+ astCache: new Map(),
45
+ packagePathMap: new Map(),
46
+ getSourceMap: (file)=>_this.sdk.getSourceMap(file)
47
+ };
48
+ const RsdoctorRspackPlugin = null == (_compiler_webpack_experiments = compiler.webpack.experiments) ? void 0 : _compiler_webpack_experiments.RsdoctorPlugin;
49
+ if (RsdoctorRspackPlugin) (0, external_rspack_cjs_namespaceObject.applyRspackNativePlugin)(compiler, _this, RsdoctorRspackPlugin);
50
+ if (!_this._realSourcePathCache) _this._realSourcePathCache = new Map();
51
+ compiler.hooks.done.tapPromise((0, external_constants_cjs_namespaceObject.internalPluginTapPreOptions)('moduleGraph'), async (_stats)=>{
52
+ await doneHandler(_stats, _this, context, compiler);
53
+ });
54
+ compiler.hooks.afterEmit.tapPromise({
55
+ ...external_constants_cjs_namespaceObject.pluginTapPostOptions,
56
+ stage: external_constants_cjs_namespaceObject.pluginTapPostOptions.stage + 100
57
+ }, async (compilation)=>{
58
+ if (!ensureDevtools(compiler)) return;
59
+ const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
60
+ await (0, external_sourcemapTool_cjs_namespaceObject.handleAfterEmitAssets)(compilation, _this, sourceMapFilenameRegex, namespace);
61
+ });
62
+ compiler.hooks.emit.tapAsync({
63
+ ...external_constants_cjs_namespaceObject.pluginTapPostOptions,
64
+ stage: external_constants_cjs_namespaceObject.pluginTapPostOptions.stage + 100
65
+ }, emitHandler.bind(null, _this, compiler));
66
+ };
67
+ async function doneHandler(_stats, _this, context, compiler) {
68
+ var _this_chunkGraph;
69
+ const stats = _stats;
70
+ const getStatsJson = (()=>{
71
+ let cached = null;
72
+ return ()=>{
73
+ if (cached) return cached;
74
+ cached = stats.toJson({
75
+ all: false,
76
+ chunks: true,
77
+ modules: true,
78
+ chunkModules: true,
79
+ assets: true,
80
+ ids: true,
81
+ hash: true,
82
+ errors: true,
83
+ warnings: true
84
+ });
85
+ return cached;
86
+ };
87
+ })();
88
+ logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
89
+ if (!(null == (_this_chunkGraph = _this.chunkGraph) ? void 0 : _this_chunkGraph.getChunks().length)) _this.chunkGraph = index_cjs_namespaceObject.Chunks.chunkTransform(new Map(), getStatsJson());
90
+ if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await index_cjs_namespaceObject.ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features, context);
91
+ logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
92
+ if (_this.options.features.treeShaking) {
93
+ if ('rspackVersion' in compiler.webpack) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow('Rspack currently does not support treeShaking capabilities.'));
94
+ else {
95
+ _this.modulesGraph = index_cjs_namespaceObject.ModuleGraph.appendTreeShaking(_this.modulesGraph, stats.compilation) || _this.modulesGraph;
96
+ _this.sdk.addClientRoutes([
97
+ types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.TreeShaking
98
+ ]);
99
+ }
100
+ logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After AppendTreeShaking to ModuleGraph]')}`);
101
+ }
102
+ const shouldParseBundle = false !== _this.options.supports.parseBundle;
103
+ await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets);
104
+ logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
105
+ _this.modulesGraph && await _this.sdk.reportModuleGraph(_this.modulesGraph);
106
+ await _this.sdk.reportChunkGraph(_this.chunkGraph);
107
+ if (_this.options.supports.generateTileGraph) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
108
+ }
109
+ const ensureDevtools = (compiler)=>{
110
+ const devtool = compiler.options.devtool;
111
+ if ('string' == typeof devtool && /eval/i.test(devtool)) {
112
+ hasConsole || logger_namespaceObject.logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
113
+ hasConsole = true;
114
+ return false;
115
+ }
116
+ if ('rspack' in compiler) return true;
117
+ const sourceMapEnabled = 'string' == typeof devtool && /source-?map/i.test(devtool);
118
+ if (!sourceMapEnabled) {
119
+ logger_namespaceObject.logger.debug('SourceMap is not enabled. Skipping sourcemap processing.');
120
+ return false;
121
+ }
122
+ return true;
123
+ };
124
+ async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets) {
125
+ if (!moduleGraph) return;
126
+ try {
127
+ await index_cjs_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle);
128
+ } catch (e) {}
129
+ }
130
+ function escapeRegExp(str) {
131
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
132
+ }
133
+ function calculateNamespaceAndRegex(compiler) {
134
+ var _compiler_options_output_library;
135
+ let namespace = compiler.options.output.devtoolNamespace || (null == (_compiler_options_output_library = compiler.options.output.library) ? void 0 : _compiler_options_output_library.name) || '[^/]+/';
136
+ if (Array.isArray(namespace)) namespace = namespace[0];
137
+ else if ('object' == typeof namespace && 'name' in namespace) namespace = namespace.name;
138
+ const safeNamespace = escapeRegExp(namespace);
139
+ const sourceMapFilenameRegex = new RegExp(`(?:webpack://)?(?:${safeNamespace})?([^?]*)`);
140
+ return {
141
+ namespace: namespace,
142
+ sourceMapFilenameRegex
143
+ };
144
+ }
145
+ async function emitHandler(_this, compiler, compilation, callback) {
146
+ if (!ensureDevtools(compiler)) return void callback();
147
+ const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
148
+ await (0, external_sourcemapTool_cjs_namespaceObject.handleEmitAssets)({
149
+ compilation,
150
+ pluginInstance: _this,
151
+ sourceMapFilenameRegex,
152
+ namespace
153
+ });
154
+ callback();
155
+ }
156
+ exports.calculateNamespaceAndRegex = __webpack_exports__.calculateNamespaceAndRegex;
157
+ exports.ensureDevtools = __webpack_exports__.ensureDevtools;
158
+ exports.ensureModulesChunksGraphFn = __webpack_exports__.ensureModulesChunksGraphFn;
159
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
160
+ "calculateNamespaceAndRegex",
161
+ "ensureDevtools",
162
+ "ensureModulesChunksGraphFn"
163
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
164
+ Object.defineProperty(exports, '__esModule', {
165
+ value: true
166
+ });
@@ -34,4 +34,3 @@ export declare function calculateNamespaceAndRegex(compiler: Plugin.BaseCompiler
34
34
  namespace: string;
35
35
  sourceMapFilenameRegex: RegExp;
36
36
  };
37
- //# sourceMappingURL=ensureModulesChunkGraph.d.ts.map
@@ -1,40 +1,12 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- calculateNamespaceAndRegex: ()=>calculateNamespaceAndRegex,
28
- ensureDevtools: ()=>ensureDevtools,
29
- ensureModulesChunksGraphFn: ()=>ensureModulesChunksGraphFn
30
- });
31
- const types_namespaceObject = require("@rsdoctor/types");
32
- const build_namespaceObject = require("@rsdoctor/utils/build");
33
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
34
- const index_js_namespaceObject = require("../../build-utils/build/index.js");
35
- const external_constants_js_namespaceObject = require("../constants.js");
36
- const external_rspack_js_namespaceObject = require("./rspack.js");
37
- const external_sourcemapTool_js_namespaceObject = require("./sourcemapTool.js");
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import { Manifest } from "@rsdoctor/types";
4
+ import { Process } from "@rsdoctor/utils/build";
5
+ import { chalk, logger } from "@rsdoctor/utils/logger";
6
+ import { Chunks, ModuleGraph } from "../../build-utils/build/index.js";
7
+ import { internalPluginTapPreOptions, pluginTapPostOptions } from "../constants.js";
8
+ import { applyRspackNativePlugin } from "./rspack.js";
9
+ import { handleAfterEmitAssets, handleEmitAssets } from "./sourcemapTool.js";
38
10
  let hasConsole = false;
39
11
  const ensureModulesChunksGraphFn = (compiler, _this)=>{
40
12
  var _compiler_webpack_experiments;
@@ -46,22 +18,22 @@ const ensureModulesChunksGraphFn = (compiler, _this)=>{
46
18
  getSourceMap: (file)=>_this.sdk.getSourceMap(file)
47
19
  };
48
20
  const RsdoctorRspackPlugin = null == (_compiler_webpack_experiments = compiler.webpack.experiments) ? void 0 : _compiler_webpack_experiments.RsdoctorPlugin;
49
- if (RsdoctorRspackPlugin) (0, external_rspack_js_namespaceObject.applyRspackNativePlugin)(compiler, _this, RsdoctorRspackPlugin);
21
+ if (RsdoctorRspackPlugin) applyRspackNativePlugin(compiler, _this, RsdoctorRspackPlugin);
50
22
  if (!_this._realSourcePathCache) _this._realSourcePathCache = new Map();
51
- compiler.hooks.done.tapPromise((0, external_constants_js_namespaceObject.internalPluginTapPreOptions)('moduleGraph'), async (_stats)=>{
23
+ compiler.hooks.done.tapPromise(internalPluginTapPreOptions('moduleGraph'), async (_stats)=>{
52
24
  await doneHandler(_stats, _this, context, compiler);
53
25
  });
54
26
  compiler.hooks.afterEmit.tapPromise({
55
- ...external_constants_js_namespaceObject.pluginTapPostOptions,
56
- stage: external_constants_js_namespaceObject.pluginTapPostOptions.stage + 100
27
+ ...pluginTapPostOptions,
28
+ stage: pluginTapPostOptions.stage + 100
57
29
  }, async (compilation)=>{
58
30
  if (!ensureDevtools(compiler)) return;
59
31
  const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
60
- await (0, external_sourcemapTool_js_namespaceObject.handleAfterEmitAssets)(compilation, _this, sourceMapFilenameRegex, namespace);
32
+ await handleAfterEmitAssets(compilation, _this, sourceMapFilenameRegex, namespace);
61
33
  });
62
34
  compiler.hooks.emit.tapAsync({
63
- ...external_constants_js_namespaceObject.pluginTapPostOptions,
64
- stage: external_constants_js_namespaceObject.pluginTapPostOptions.stage + 100
35
+ ...pluginTapPostOptions,
36
+ stage: pluginTapPostOptions.stage + 100
65
37
  }, emitHandler.bind(null, _this, compiler));
66
38
  };
67
39
  async function doneHandler(_stats, _this, context, compiler) {
@@ -71,42 +43,52 @@ async function doneHandler(_stats, _this, context, compiler) {
71
43
  let cached = null;
72
44
  return ()=>{
73
45
  if (cached) return cached;
74
- cached = stats.toJson();
46
+ cached = stats.toJson({
47
+ all: false,
48
+ chunks: true,
49
+ modules: true,
50
+ chunkModules: true,
51
+ assets: true,
52
+ ids: true,
53
+ hash: true,
54
+ errors: true,
55
+ warnings: true
56
+ });
75
57
  return cached;
76
58
  };
77
59
  })();
78
- logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
79
- if (!(null == (_this_chunkGraph = _this.chunkGraph) ? void 0 : _this_chunkGraph.getChunks().length)) _this.chunkGraph = index_js_namespaceObject.Chunks.chunkTransform(new Map(), getStatsJson());
80
- if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await index_js_namespaceObject.ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features, context);
81
- logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
60
+ logger.debug(`${(Process.getMemoryUsageMessage(), '[Before Generate ModuleGraph]')}`);
61
+ if (!(null == (_this_chunkGraph = _this.chunkGraph) ? void 0 : _this_chunkGraph.getChunks().length)) _this.chunkGraph = Chunks.chunkTransform(new Map(), getStatsJson());
62
+ if (!_this.modulesGraph.getModules().length) _this.modulesGraph = await ModuleGraph.getModuleGraphByStats(stats.compilation, getStatsJson(), process.cwd(), _this.chunkGraph, _this.options.features, context);
63
+ logger.debug(`${(Process.getMemoryUsageMessage(), '[After Generate ModuleGraph]')}`);
82
64
  if (_this.options.features.treeShaking) {
83
- if ('rspackVersion' in compiler.webpack) logger_namespaceObject.logger.info(logger_namespaceObject.chalk.yellow('Rspack currently does not support treeShaking capabilities.'));
65
+ if ('rspackVersion' in compiler.webpack) logger.info(chalk.yellow('Rspack currently does not support treeShaking capabilities.'));
84
66
  else {
85
- _this.modulesGraph = index_js_namespaceObject.ModuleGraph.appendTreeShaking(_this.modulesGraph, stats.compilation) || _this.modulesGraph;
67
+ _this.modulesGraph = ModuleGraph.appendTreeShaking(_this.modulesGraph, stats.compilation) || _this.modulesGraph;
86
68
  _this.sdk.addClientRoutes([
87
- types_namespaceObject.Manifest.RsdoctorManifestClientRoutes.TreeShaking
69
+ Manifest.RsdoctorManifestClientRoutes.TreeShaking
88
70
  ]);
89
71
  }
90
- logger_namespaceObject.logger.debug(`${(build_namespaceObject.Process.getMemoryUsageMessage(), '[After AppendTreeShaking to ModuleGraph]')}`);
72
+ logger.debug(`${(Process.getMemoryUsageMessage(), '[After AppendTreeShaking to ModuleGraph]')}`);
91
73
  }
92
74
  const shouldParseBundle = false !== _this.options.supports.parseBundle;
93
75
  await getModulesInfos(compiler, _this.modulesGraph, _this.chunkGraph, shouldParseBundle, _this.sourceMapSets);
94
- logger_namespaceObject.logger.debug(`${build_namespaceObject.Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
76
+ logger.debug(`${Process.getMemoryUsageMessage()}, '[After Transform ModuleGraph]'`);
95
77
  _this.modulesGraph && await _this.sdk.reportModuleGraph(_this.modulesGraph);
96
78
  await _this.sdk.reportChunkGraph(_this.chunkGraph);
97
- if (_this.options.supports.generateTileGraph) logger_namespaceObject.logger.warn(logger_namespaceObject.chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
79
+ if (_this.options.supports.generateTileGraph) logger.warn(chalk.yellow('The option generateTileGraph is deprecated. Treemap (i.e. Tile Graph) is now supported by default.'));
98
80
  }
99
81
  const ensureDevtools = (compiler)=>{
100
82
  const devtool = compiler.options.devtool;
101
83
  if ('string' == typeof devtool && /eval/i.test(devtool)) {
102
- hasConsole || logger_namespaceObject.logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
84
+ hasConsole || logger.warn('SourceMap with eval is not supported. Please use other sourcemap options.');
103
85
  hasConsole = true;
104
86
  return false;
105
87
  }
106
88
  if ('rspack' in compiler) return true;
107
89
  const sourceMapEnabled = 'string' == typeof devtool && /source-?map/i.test(devtool);
108
90
  if (!sourceMapEnabled) {
109
- logger_namespaceObject.logger.debug('SourceMap is not enabled. Skipping sourcemap processing.');
91
+ logger.debug('SourceMap is not enabled. Skipping sourcemap processing.');
110
92
  return false;
111
93
  }
112
94
  return true;
@@ -114,7 +96,7 @@ const ensureDevtools = (compiler)=>{
114
96
  async function getModulesInfos(compiler, moduleGraph, chunkGraph, parseBundle, sourceMapSets) {
115
97
  if (!moduleGraph) return;
116
98
  try {
117
- await index_js_namespaceObject.Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle);
99
+ await Chunks.getAssetsModulesData(moduleGraph, chunkGraph, compiler.outputPath, sourceMapSets, parseBundle);
118
100
  } catch (e) {}
119
101
  }
120
102
  function escapeRegExp(str) {
@@ -135,7 +117,7 @@ function calculateNamespaceAndRegex(compiler) {
135
117
  async function emitHandler(_this, compiler, compilation, callback) {
136
118
  if (!ensureDevtools(compiler)) return void callback();
137
119
  const { namespace, sourceMapFilenameRegex } = calculateNamespaceAndRegex(compiler);
138
- await (0, external_sourcemapTool_js_namespaceObject.handleEmitAssets)({
120
+ await handleEmitAssets({
139
121
  compilation,
140
122
  pluginInstance: _this,
141
123
  sourceMapFilenameRegex,
@@ -143,14 +125,4 @@ async function emitHandler(_this, compiler, compilation, callback) {
143
125
  });
144
126
  callback();
145
127
  }
146
- exports.calculateNamespaceAndRegex = __webpack_exports__.calculateNamespaceAndRegex;
147
- exports.ensureDevtools = __webpack_exports__.ensureDevtools;
148
- exports.ensureModulesChunksGraphFn = __webpack_exports__.ensureModulesChunksGraphFn;
149
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
150
- "calculateNamespaceAndRegex",
151
- "ensureDevtools",
152
- "ensureModulesChunksGraphFn"
153
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
154
- Object.defineProperty(exports, '__esModule', {
155
- value: true
156
- });
128
+ export { calculateNamespaceAndRegex, ensureDevtools, ensureModulesChunksGraphFn };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ InternalErrorReporterPlugin: ()=>InternalErrorReporterPlugin
28
+ });
29
+ const types_namespaceObject = require("@rsdoctor/types");
30
+ const external_base_cjs_namespaceObject = require("./base.cjs");
31
+ const error_namespaceObject = require("@rsdoctor/utils/error");
32
+ const logger_namespaceObject = require("@rsdoctor/utils/logger");
33
+ class InternalErrorReporterPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
34
+ apply(compiler) {
35
+ (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.apply');
36
+ try {
37
+ compiler.hooks.done.tapPromise(this.tapPreOptions, this.done);
38
+ } finally{
39
+ (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.apply');
40
+ }
41
+ }
42
+ handleWebpackError(err, category, level) {
43
+ return error_namespaceObject.DevToolError.from(err, {
44
+ category,
45
+ code: types_namespaceObject.Rule.RuleMessageCodeEnumerated.Overlay,
46
+ controller: {
47
+ noStack: false
48
+ },
49
+ detail: {
50
+ stack: 'stack' in err ? err.stack : err.message
51
+ },
52
+ level
53
+ });
54
+ }
55
+ async reportWarnings(warnings) {
56
+ (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportWarnings');
57
+ try {
58
+ const arr = warnings.map((warning)=>this.handleWebpackError(warning, types_namespaceObject.Rule.RuleMessageCategory.Compile, 'Warn'));
59
+ this.sdk.reportError(arr);
60
+ } finally{
61
+ (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportWarnings');
62
+ }
63
+ }
64
+ async reportErrors(errors) {
65
+ (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportErrors');
66
+ try {
67
+ const arr = errors.map((err)=>this.handleWebpackError(err, types_namespaceObject.Rule.RuleMessageCategory.Bundle, 'Error'));
68
+ this.sdk.reportError(arr);
69
+ } finally{
70
+ (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportErrors');
71
+ }
72
+ }
73
+ constructor(...args){
74
+ super(...args), this.name = 'error-reporter', this.done = async (stats)=>{
75
+ (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.done');
76
+ try {
77
+ const tasks = [];
78
+ const statsData = stats.toJson({
79
+ all: false,
80
+ errors: true,
81
+ warnings: true
82
+ });
83
+ if (stats.hasErrors()) tasks.push(this.reportErrors(statsData.errors || []));
84
+ if (stats.hasWarnings()) tasks.push(this.reportWarnings(statsData.warnings || []));
85
+ await Promise.all(tasks);
86
+ } finally{
87
+ (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.done');
88
+ }
89
+ };
90
+ }
91
+ }
92
+ exports.InternalErrorReporterPlugin = __webpack_exports__.InternalErrorReporterPlugin;
93
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
94
+ "InternalErrorReporterPlugin"
95
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
96
+ Object.defineProperty(exports, '__esModule', {
97
+ value: true
98
+ });
@@ -9,4 +9,3 @@ export declare class InternalErrorReporterPlugin<T extends Plugin.BaseCompiler>
9
9
  reportWarnings(warnings: Plugin.BuildError[]): Promise<void>;
10
10
  reportErrors(errors: Plugin.BuildWarning[]): Promise<void>;
11
11
  }
12
- //# sourceMappingURL=errors.d.ts.map
@@ -1,48 +1,22 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, definition)=>{
5
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
- enumerable: true,
7
- get: definition[key]
8
- });
9
- };
10
- })();
11
- (()=>{
12
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
- })();
14
- (()=>{
15
- __webpack_require__.r = (exports1)=>{
16
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
- value: 'Module'
18
- });
19
- Object.defineProperty(exports1, '__esModule', {
20
- value: true
21
- });
22
- };
23
- })();
24
- var __webpack_exports__ = {};
25
- __webpack_require__.r(__webpack_exports__);
26
- __webpack_require__.d(__webpack_exports__, {
27
- InternalErrorReporterPlugin: ()=>InternalErrorReporterPlugin
28
- });
29
- const types_namespaceObject = require("@rsdoctor/types");
30
- const external_base_js_namespaceObject = require("./base.js");
31
- const error_namespaceObject = require("@rsdoctor/utils/error");
32
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
33
- class InternalErrorReporterPlugin extends external_base_js_namespaceObject.InternalBasePlugin {
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import { Rule } from "@rsdoctor/types";
4
+ import { InternalBasePlugin } from "./base.js";
5
+ import { DevToolError } from "@rsdoctor/utils/error";
6
+ import { time, timeEnd } from "@rsdoctor/utils/logger";
7
+ class InternalErrorReporterPlugin extends InternalBasePlugin {
34
8
  apply(compiler) {
35
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.apply');
9
+ time('InternalErrorReporterPlugin.apply');
36
10
  try {
37
11
  compiler.hooks.done.tapPromise(this.tapPreOptions, this.done);
38
12
  } finally{
39
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.apply');
13
+ timeEnd('InternalErrorReporterPlugin.apply');
40
14
  }
41
15
  }
42
16
  handleWebpackError(err, category, level) {
43
- return error_namespaceObject.DevToolError.from(err, {
17
+ return DevToolError.from(err, {
44
18
  category,
45
- code: types_namespaceObject.Rule.RuleMessageCodeEnumerated.Overlay,
19
+ code: Rule.RuleMessageCodeEnumerated.Overlay,
46
20
  controller: {
47
21
  noStack: false
48
22
  },
@@ -53,26 +27,26 @@ class InternalErrorReporterPlugin extends external_base_js_namespaceObject.Inter
53
27
  });
54
28
  }
55
29
  async reportWarnings(warnings) {
56
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportWarnings');
30
+ time('InternalErrorReporterPlugin.reportWarnings');
57
31
  try {
58
- const arr = warnings.map((warning)=>this.handleWebpackError(warning, types_namespaceObject.Rule.RuleMessageCategory.Compile, 'Warn'));
32
+ const arr = warnings.map((warning)=>this.handleWebpackError(warning, Rule.RuleMessageCategory.Compile, 'Warn'));
59
33
  this.sdk.reportError(arr);
60
34
  } finally{
61
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportWarnings');
35
+ timeEnd('InternalErrorReporterPlugin.reportWarnings');
62
36
  }
63
37
  }
64
38
  async reportErrors(errors) {
65
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.reportErrors');
39
+ time('InternalErrorReporterPlugin.reportErrors');
66
40
  try {
67
- const arr = errors.map((err)=>this.handleWebpackError(err, types_namespaceObject.Rule.RuleMessageCategory.Bundle, 'Error'));
41
+ const arr = errors.map((err)=>this.handleWebpackError(err, Rule.RuleMessageCategory.Bundle, 'Error'));
68
42
  this.sdk.reportError(arr);
69
43
  } finally{
70
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.reportErrors');
44
+ timeEnd('InternalErrorReporterPlugin.reportErrors');
71
45
  }
72
46
  }
73
47
  constructor(...args){
74
48
  super(...args), this.name = 'error-reporter', this.done = async (stats)=>{
75
- (0, logger_namespaceObject.time)('InternalErrorReporterPlugin.done');
49
+ time('InternalErrorReporterPlugin.done');
76
50
  try {
77
51
  const tasks = [];
78
52
  const statsData = stats.toJson({
@@ -84,15 +58,9 @@ class InternalErrorReporterPlugin extends external_base_js_namespaceObject.Inter
84
58
  if (stats.hasWarnings()) tasks.push(this.reportWarnings(statsData.warnings || []));
85
59
  await Promise.all(tasks);
86
60
  } finally{
87
- (0, logger_namespaceObject.timeEnd)('InternalErrorReporterPlugin.done');
61
+ timeEnd('InternalErrorReporterPlugin.done');
88
62
  }
89
63
  };
90
64
  }
91
65
  }
92
- exports.InternalErrorReporterPlugin = __webpack_exports__.InternalErrorReporterPlugin;
93
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
94
- "InternalErrorReporterPlugin"
95
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
96
- Object.defineProperty(exports, '__esModule', {
97
- value: true
98
- });
66
+ export { InternalErrorReporterPlugin };