@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,284 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ parseBundle: ()=>parseBundle
37
+ });
38
+ const external_fs_namespaceObject = require("fs");
39
+ var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
40
+ const external_lodash_es_namespaceObject = require("lodash-es");
41
+ const external_filesize_namespaceObject = require("filesize");
42
+ const ruleUtils_namespaceObject = require("@rsdoctor/utils/ruleUtils");
43
+ const external_path_namespaceObject = require("path");
44
+ const logger_namespaceObject = require("@rsdoctor/utils/logger");
45
+ const parseBundle = (bundlePath, modulesData)=>{
46
+ if (bundlePath.indexOf('.worker.') > 0) return {};
47
+ if ('.js' !== (0, external_path_namespaceObject.extname)(bundlePath)) return {};
48
+ let content = external_fs_default().readFileSync(bundlePath, 'utf8');
49
+ const tagCache = new Map();
50
+ let hasBannerPlugin = content.indexOf('RSDOCTOR_START::') > 0;
51
+ if (hasBannerPlugin && !tagCache.get(bundlePath)) {
52
+ var _tagMatchResult_result;
53
+ const tagMatchResult = getStringBetween(content, 0, /([a-z|A-Z|_]+\.[a-z]+)\(\SRSDOCTOR_START::(.*?)[;,]/, /([a-z|A-Z|_]+\.[a-z]+)\(\SRSDOCTOR_END::(.*?)\)/);
54
+ content = (null == (_tagMatchResult_result = tagMatchResult.result) ? void 0 : _tagMatchResult_result.trim()) || content;
55
+ tagCache.set(bundlePath, tagMatchResult.loc);
56
+ hasBannerPlugin = true;
57
+ } else if (hasBannerPlugin && !tagCache.get(bundlePath)) {
58
+ const loc = tagCache.get(bundlePath);
59
+ content = content.slice(loc.start, loc.end);
60
+ hasBannerPlugin = true;
61
+ }
62
+ const ast = ruleUtils_namespaceObject.parser.internal.parse(content, {
63
+ sourceType: "script",
64
+ ecmaVersion: 'latest'
65
+ });
66
+ const walkState = {
67
+ locations: null,
68
+ expressionStatementDepth: 0
69
+ };
70
+ ruleUtils_namespaceObject.parser.walk.recursive(ast, walkState, {
71
+ ExpressionStatement (node, state, c) {
72
+ if (state.locations) return;
73
+ state.expressionStatementDepth++;
74
+ try {
75
+ if (1 === state.expressionStatementDepth && isIIFE(node)) {
76
+ const fn = getIIFECallExpression(node);
77
+ if (0 === fn.arguments.length && 0 === fn.callee.params.length) {
78
+ const firstVariableDeclaration = fn.callee.body.body.find((node)=>'VariableDeclaration' === node.type);
79
+ if (firstVariableDeclaration) {
80
+ for (const declaration of firstVariableDeclaration.declarations)if (declaration.init) {
81
+ state.locations = getModulesLocations(declaration.init);
82
+ if (state.locations) break;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ if (!state.locations) c(node.expression, state);
88
+ } catch (e) {
89
+ logger_namespaceObject.logger.debug(e);
90
+ }
91
+ state.expressionStatementDepth--;
92
+ },
93
+ Program (node, state, _c) {
94
+ if (state.locations) return;
95
+ try {
96
+ if (hasBannerPlugin) {
97
+ const firstVariableDeclaration = node.body.find((node)=>{
98
+ var _node_declarations__init, _node_declarations_, _node_declarations, _node_declarations__init_properties, _node_declarations__init1, _node_declarations_1, _node_declarations1;
99
+ return 'VariableDeclaration' === node.type && (null == (_node_declarations = node.declarations) ? void 0 : null == (_node_declarations_ = _node_declarations[0]) ? void 0 : null == (_node_declarations__init = _node_declarations_.init) ? void 0 : _node_declarations__init.type) === 'ObjectExpression' && (null == (_node_declarations1 = node.declarations) ? void 0 : null == (_node_declarations_1 = _node_declarations1[0]) ? void 0 : null == (_node_declarations__init1 = _node_declarations_1.init) ? void 0 : null == (_node_declarations__init_properties = _node_declarations__init1.properties) ? void 0 : _node_declarations__init_properties.length);
100
+ });
101
+ if (firstVariableDeclaration) {
102
+ for (const declaration of firstVariableDeclaration.declarations)if (declaration.init) {
103
+ state.locations = getModulesLocations(declaration.init);
104
+ if (state.locations) break;
105
+ }
106
+ }
107
+ }
108
+ if (!state.locations) node.body.forEach((n)=>_c(n, state));
109
+ } catch (e) {
110
+ logger_namespaceObject.logger.debug(e);
111
+ }
112
+ state.expressionStatementDepth--;
113
+ },
114
+ AssignmentExpression (node, state) {
115
+ if (state.locations) return;
116
+ const { left, right } = node;
117
+ if ((null == left ? void 0 : left.object) && 'exports' === left.object.name && left.property && 'modules' === left.property.name && isModulesHash(right)) state.locations = getModulesLocations(right);
118
+ },
119
+ CallExpression (node, state, c) {
120
+ if (state.locations) return;
121
+ const args = node.arguments;
122
+ if ('FunctionExpression' === node.callee.type && !node.callee.id && 1 === args.length && isSimpleModulesList(args[0])) {
123
+ state.locations = getModulesLocations(args[0]);
124
+ return;
125
+ }
126
+ if ('Identifier' === node.callee.type && mayBeAsyncChunkArguments(args) && isModulesList(args[1])) {
127
+ state.locations = getModulesLocations(args[1]);
128
+ return;
129
+ }
130
+ if (isAsyncChunkPushExpression(node)) {
131
+ state.locations = getModulesLocations(args[0].elements[1]);
132
+ return;
133
+ }
134
+ if (isAsyncWebWorkerChunkExpression(node)) {
135
+ state.locations = getModulesLocations(args[1]);
136
+ return;
137
+ }
138
+ args.forEach((arg)=>c(arg, state));
139
+ }
140
+ });
141
+ let modules;
142
+ modules = walkState.locations ? (0, external_lodash_es_namespaceObject.mapValues)(walkState.locations, (loc)=>content.slice(loc.start, loc.end)) : {};
143
+ const modulesObj = {};
144
+ for(const module in modules){
145
+ var _find;
146
+ if (!module) return {};
147
+ const moduleContent = modules[module];
148
+ const size = moduleContent && Buffer.byteLength(moduleContent);
149
+ const identifier = (null == (_find = (0, external_lodash_es_namespaceObject.find)(modulesData, {
150
+ renderId: module
151
+ })) ? void 0 : _find.webpackId) || '';
152
+ modulesObj[identifier] = {
153
+ size,
154
+ sizeConvert: (0, external_filesize_namespaceObject.filesize)(size || 0),
155
+ content: moduleContent
156
+ };
157
+ }
158
+ return {
159
+ modules: modulesObj,
160
+ src: content,
161
+ runtimeSrc: getBundleRuntime(content, walkState.locations)
162
+ };
163
+ };
164
+ function getBundleRuntime(content, modulesLocations) {
165
+ const sortedLocations = Object.values(modulesLocations || {}).sort((a, b)=>a.start - b.start);
166
+ let result = '';
167
+ let lastIndex = 0;
168
+ for (const { start, end } of sortedLocations){
169
+ result += content.slice(lastIndex, start);
170
+ lastIndex = end;
171
+ }
172
+ return result + content.slice(lastIndex, content.length);
173
+ }
174
+ function isIIFE(node) {
175
+ return 'ExpressionStatement' === node.type && ('CallExpression' === node.expression.type || 'UnaryExpression' === node.expression.type && 'CallExpression' === node.expression.argument.type);
176
+ }
177
+ function getIIFECallExpression(node) {
178
+ if ('UnaryExpression' === node.expression.type) return node.expression.argument;
179
+ return node.expression;
180
+ }
181
+ function isModulesList(node) {
182
+ return isSimpleModulesList(node) || isOptimizedModulesArray(node);
183
+ }
184
+ function isSimpleModulesList(node) {
185
+ return isModulesHash(node) || isModulesArray(node);
186
+ }
187
+ function isModulesHash(node) {
188
+ return 'ObjectExpression' === node.type && node.properties.map((node)=>node.value).every(isModuleWrapper);
189
+ }
190
+ function isModulesArray(node) {
191
+ return 'ArrayExpression' === node.type && node.elements.every((elem)=>!elem || isModuleWrapper(elem));
192
+ }
193
+ function isOptimizedModulesArray(node) {
194
+ return 'CallExpression' === node.type && 'MemberExpression' === node.callee.type && 'CallExpression' === node.callee.object.type && 'Identifier' === node.callee.object.callee.type && 'Array' === node.callee.object.callee.name && 1 === node.callee.object.arguments.length && isNumericId(node.callee.object.arguments[0]) && 'Identifier' === node.callee.property.type && 'concat' === node.callee.property.name && 1 === node.arguments.length && isModulesArray(node.arguments[0]);
195
+ }
196
+ function isModuleWrapper(node) {
197
+ return ('FunctionExpression' === node.type || 'ArrowFunctionExpression' === node.type) && !node.id || isModuleId(node) || 'ArrayExpression' === node.type && node.elements.length > 1 && isModuleId(node.elements[0]);
198
+ }
199
+ function isModuleId(node) {
200
+ return 'Literal' === node.type && (isNumericId(node) || 'string' == typeof node.value);
201
+ }
202
+ function isNumericId(node) {
203
+ return 'Literal' === node.type && Number.isInteger(node.value) && node.value >= 0;
204
+ }
205
+ function isChunkIds(node) {
206
+ return 'ArrayExpression' === node.type && node.elements.every(isModuleId);
207
+ }
208
+ function isAsyncChunkPushExpression(node) {
209
+ const { callee, arguments: args } = node;
210
+ return 'MemberExpression' === callee.type && 'push' === callee.property.name && 'AssignmentExpression' === callee.object.type && 1 === args.length && 'ArrayExpression' === args[0].type && mayBeAsyncChunkArguments(args[0].elements) && isModulesList(args[0].elements[1]);
211
+ }
212
+ function mayBeAsyncChunkArguments(args) {
213
+ return args.length >= 2 && isChunkIds(args[0]);
214
+ }
215
+ function isAsyncWebWorkerChunkExpression(node) {
216
+ const { callee, type, arguments: args } = node;
217
+ return 'CallExpression' === type && 'MemberExpression' === callee.type && 2 === args.length && isChunkIds(args[0]) && isModulesList(args[1]);
218
+ }
219
+ function getModulesLocations(node) {
220
+ if ('ObjectExpression' === node.type) {
221
+ const modulesNodes = node.properties;
222
+ return modulesNodes.reduce((result, moduleNode)=>{
223
+ const moduleId = moduleNode.key.name || moduleNode.key.value;
224
+ result[moduleId] = getModuleLocation(moduleNode.value);
225
+ return result;
226
+ }, {});
227
+ }
228
+ const isOptimizedArray = 'CallExpression' === node.type;
229
+ if ('ArrayExpression' === node.type || isOptimizedArray) {
230
+ const minId = isOptimizedArray ? node.callee.object.arguments[0].value : 0;
231
+ const modulesNodes = isOptimizedArray ? node.arguments[0].elements : node.elements;
232
+ return modulesNodes.reduce((result, moduleNode, i)=>{
233
+ if (moduleNode) result[i + minId] = getModuleLocation(moduleNode);
234
+ return result;
235
+ }, {});
236
+ }
237
+ return {};
238
+ }
239
+ function getModuleLocation(node) {
240
+ return {
241
+ start: node.start,
242
+ end: node.end
243
+ };
244
+ }
245
+ function getStringBetween(raw, position, start, end) {
246
+ try {
247
+ const matchStart = raw.match(start);
248
+ const startFlagIndex = (null == matchStart ? void 0 : matchStart.length) ? raw.indexOf(matchStart[0], position) : -1;
249
+ if (-1 === startFlagIndex || !(null == matchStart ? void 0 : matchStart.length)) return {
250
+ result: null,
251
+ remain: position
252
+ };
253
+ const startTagLength = matchStart[0].length;
254
+ const matchEnd = raw.match(end);
255
+ const endFlagIndex = (null == matchEnd ? void 0 : matchEnd.length) ? raw.indexOf(matchEnd[0], startFlagIndex + startTagLength) : -1;
256
+ if (-1 === endFlagIndex || !(null == matchEnd ? void 0 : matchEnd.length)) return {
257
+ result: null,
258
+ remain: position
259
+ };
260
+ let innerContent = raw.slice(startFlagIndex + startTagLength, endFlagIndex).trim();
261
+ if (innerContent.endsWith(',')) innerContent = innerContent.slice(0, -1);
262
+ return {
263
+ result: innerContent,
264
+ remain: (null == matchEnd ? void 0 : matchEnd.length) ? endFlagIndex + matchEnd[0].length : endFlagIndex,
265
+ loc: {
266
+ start: startFlagIndex + startTagLength,
267
+ end: endFlagIndex
268
+ }
269
+ };
270
+ } catch (e) {
271
+ logger_namespaceObject.logger.debug(()=>e);
272
+ return {
273
+ result: null,
274
+ remain: position
275
+ };
276
+ }
277
+ }
278
+ exports.parseBundle = __webpack_exports__.parseBundle;
279
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
280
+ "parseBundle"
281
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
282
+ Object.defineProperty(exports, '__esModule', {
283
+ value: true
284
+ });
@@ -1,4 +1,4 @@
1
- import { ParseBundle } from '../../../types';
1
+ import type { ParseBundle } from '@rsdoctor/graph';
2
2
  /**
3
3
  * The following code is based on
4
4
  * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/src/parseUtils.js#L10
@@ -10,4 +10,3 @@ import { ParseBundle } from '../../../types';
10
10
  * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
11
11
  */
12
12
  export declare const parseBundle: ParseBundle;
13
- //# sourceMappingURL=parseBundle.d.ts.map
@@ -1,51 +1,15 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, definition)=>{
14
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
- enumerable: true,
16
- get: definition[key]
17
- });
18
- };
19
- })();
20
- (()=>{
21
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
- })();
23
- (()=>{
24
- __webpack_require__.r = (exports1)=>{
25
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
- value: 'Module'
27
- });
28
- Object.defineProperty(exports1, '__esModule', {
29
- value: true
30
- });
31
- };
32
- })();
33
- var __webpack_exports__ = {};
34
- __webpack_require__.r(__webpack_exports__);
35
- __webpack_require__.d(__webpack_exports__, {
36
- parseBundle: ()=>parseBundle
37
- });
38
- const external_fs_namespaceObject = require("fs");
39
- var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
40
- const external_lodash_namespaceObject = require("lodash");
41
- const external_filesize_namespaceObject = require("filesize");
42
- const ruleUtils_namespaceObject = require("@rsdoctor/utils/ruleUtils");
43
- const external_path_namespaceObject = require("path");
44
- const logger_namespaceObject = require("@rsdoctor/utils/logger");
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import fs from "fs";
4
+ import { find, mapValues } from "lodash-es";
5
+ import { filesize } from "filesize";
6
+ import { parser } from "@rsdoctor/utils/ruleUtils";
7
+ import { extname } from "path";
8
+ import { logger } from "@rsdoctor/utils/logger";
45
9
  const parseBundle = (bundlePath, modulesData)=>{
46
10
  if (bundlePath.indexOf('.worker.') > 0) return {};
47
- if ('.js' !== (0, external_path_namespaceObject.extname)(bundlePath)) return {};
48
- let content = external_fs_default().readFileSync(bundlePath, 'utf8');
11
+ if ('.js' !== extname(bundlePath)) return {};
12
+ let content = fs.readFileSync(bundlePath, 'utf8');
49
13
  const tagCache = new Map();
50
14
  let hasBannerPlugin = content.indexOf('RSDOCTOR_START::') > 0;
51
15
  if (hasBannerPlugin && !tagCache.get(bundlePath)) {
@@ -59,7 +23,7 @@ const parseBundle = (bundlePath, modulesData)=>{
59
23
  content = content.slice(loc.start, loc.end);
60
24
  hasBannerPlugin = true;
61
25
  }
62
- const ast = ruleUtils_namespaceObject.parser.internal.parse(content, {
26
+ const ast = parser.internal.parse(content, {
63
27
  sourceType: "script",
64
28
  ecmaVersion: 'latest'
65
29
  });
@@ -67,7 +31,7 @@ const parseBundle = (bundlePath, modulesData)=>{
67
31
  locations: null,
68
32
  expressionStatementDepth: 0
69
33
  };
70
- ruleUtils_namespaceObject.parser.walk.recursive(ast, walkState, {
34
+ parser.walk.recursive(ast, walkState, {
71
35
  ExpressionStatement (node, state, c) {
72
36
  if (state.locations) return;
73
37
  state.expressionStatementDepth++;
@@ -86,7 +50,7 @@ const parseBundle = (bundlePath, modulesData)=>{
86
50
  }
87
51
  if (!state.locations) c(node.expression, state);
88
52
  } catch (e) {
89
- logger_namespaceObject.logger.debug(e);
53
+ logger.debug(e);
90
54
  }
91
55
  state.expressionStatementDepth--;
92
56
  },
@@ -107,7 +71,7 @@ const parseBundle = (bundlePath, modulesData)=>{
107
71
  }
108
72
  if (!state.locations) node.body.forEach((n)=>_c(n, state));
109
73
  } catch (e) {
110
- logger_namespaceObject.logger.debug(e);
74
+ logger.debug(e);
111
75
  }
112
76
  state.expressionStatementDepth--;
113
77
  },
@@ -139,19 +103,19 @@ const parseBundle = (bundlePath, modulesData)=>{
139
103
  }
140
104
  });
141
105
  let modules;
142
- modules = walkState.locations ? (0, external_lodash_namespaceObject.mapValues)(walkState.locations, (loc)=>content.slice(loc.start, loc.end)) : {};
106
+ modules = walkState.locations ? mapValues(walkState.locations, (loc)=>content.slice(loc.start, loc.end)) : {};
143
107
  const modulesObj = {};
144
108
  for(const module in modules){
145
109
  var _find;
146
110
  if (!module) return {};
147
111
  const moduleContent = modules[module];
148
112
  const size = moduleContent && Buffer.byteLength(moduleContent);
149
- const identifier = (null == (_find = (0, external_lodash_namespaceObject.find)(modulesData, {
113
+ const identifier = (null == (_find = find(modulesData, {
150
114
  renderId: module
151
115
  })) ? void 0 : _find.webpackId) || '';
152
116
  modulesObj[identifier] = {
153
117
  size,
154
- sizeConvert: (0, external_filesize_namespaceObject.filesize)(size || 0),
118
+ sizeConvert: filesize(size || 0),
155
119
  content: moduleContent
156
120
  };
157
121
  }
@@ -268,17 +232,11 @@ function getStringBetween(raw, position, start, end) {
268
232
  }
269
233
  };
270
234
  } catch (e) {
271
- logger_namespaceObject.logger.debug(()=>e);
235
+ logger.debug(()=>e);
272
236
  return {
273
237
  result: null,
274
238
  remain: position
275
239
  };
276
240
  }
277
241
  }
278
- exports.parseBundle = __webpack_exports__.parseBundle;
279
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
280
- "parseBundle"
281
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
282
- Object.defineProperty(exports, '__esModule', {
283
- value: true
284
- });
242
+ export { parseBundle };
@@ -0,0 +1,61 @@
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
+ interceptCompilationHooks: ()=>interceptCompilationHooks,
28
+ interceptCompilerHooks: ()=>interceptCompilerHooks,
29
+ shouldInterceptPluginHook: ()=>shouldInterceptPluginHook
30
+ });
31
+ const graph_namespaceObject = require("@rsdoctor/graph");
32
+ function shouldInterceptPluginHook(hook) {
33
+ if (hook && hook._fakeHook) return false;
34
+ if ((null == hook ? void 0 : hook.isUsed) && 'function' == typeof hook.isUsed) return hook.isUsed();
35
+ if ((null == hook ? void 0 : hook._map) && 0 === hook._map.size) return false;
36
+ return true;
37
+ }
38
+ function interceptCompilerHooks(compiler, interceptor) {
39
+ Object.keys(compiler.hooks).forEach((hook)=>{
40
+ const v = compiler.hooks[hook];
41
+ if (shouldInterceptPluginHook(v)) interceptor(hook, v, 'compiler');
42
+ });
43
+ }
44
+ function interceptCompilationHooks(compilation, interceptor) {
45
+ Object.keys(compilation.hooks).forEach((hook)=>{
46
+ if ('normalModuleLoader' === hook && graph_namespaceObject.ModuleGraphTrans.isWebpack5orRspack(compilation)) return;
47
+ const v = compilation.hooks[hook];
48
+ if (shouldInterceptPluginHook(v)) interceptor(hook, v, 'compilation');
49
+ });
50
+ }
51
+ exports.interceptCompilationHooks = __webpack_exports__.interceptCompilationHooks;
52
+ exports.interceptCompilerHooks = __webpack_exports__.interceptCompilerHooks;
53
+ exports.shouldInterceptPluginHook = __webpack_exports__.shouldInterceptPluginHook;
54
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
55
+ "interceptCompilationHooks",
56
+ "interceptCompilerHooks",
57
+ "shouldInterceptPluginHook"
58
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
59
+ Object.defineProperty(exports, '__esModule', {
60
+ value: true
61
+ });
@@ -3,4 +3,3 @@ export type IHook = Plugin.BaseCompiler['hooks'][keyof Plugin.BaseCompiler['hook
3
3
  export declare function shouldInterceptPluginHook<T extends IHook>(hook: T): boolean;
4
4
  export declare function interceptCompilerHooks(compiler: Plugin.BaseCompiler, interceptor: (name: string, hook: IHook, scope: 'compiler') => void): void;
5
5
  export declare function interceptCompilationHooks(compilation: Plugin.BaseCompilation, interceptor: (name: string, hook: IHook, scope: 'compilation') => void): void;
6
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,34 +1,6 @@
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
- interceptCompilationHooks: ()=>interceptCompilationHooks,
28
- interceptCompilerHooks: ()=>interceptCompilerHooks,
29
- shouldInterceptPluginHook: ()=>shouldInterceptPluginHook
30
- });
31
- const compatible_js_namespaceObject = require("../../common/module-graph/compatible.js");
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import { ModuleGraphTrans } from "@rsdoctor/graph";
32
4
  function shouldInterceptPluginHook(hook) {
33
5
  if (hook && hook._fakeHook) return false;
34
6
  if ((null == hook ? void 0 : hook.isUsed) && 'function' == typeof hook.isUsed) return hook.isUsed();
@@ -43,19 +15,9 @@ function interceptCompilerHooks(compiler, interceptor) {
43
15
  }
44
16
  function interceptCompilationHooks(compilation, interceptor) {
45
17
  Object.keys(compilation.hooks).forEach((hook)=>{
46
- if ('normalModuleLoader' === hook && (0, compatible_js_namespaceObject.isWebpack5orRspack)(compilation)) return;
18
+ if ('normalModuleLoader' === hook && ModuleGraphTrans.isWebpack5orRspack(compilation)) return;
47
19
  const v = compilation.hooks[hook];
48
20
  if (shouldInterceptPluginHook(v)) interceptor(hook, v, 'compilation');
49
21
  });
50
22
  }
51
- exports.interceptCompilationHooks = __webpack_exports__.interceptCompilationHooks;
52
- exports.interceptCompilerHooks = __webpack_exports__.interceptCompilerHooks;
53
- exports.shouldInterceptPluginHook = __webpack_exports__.shouldInterceptPluginHook;
54
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
55
- "interceptCompilationHooks",
56
- "interceptCompilerHooks",
57
- "shouldInterceptPluginHook"
58
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
59
- Object.defineProperty(exports, '__esModule', {
60
- value: true
61
- });
23
+ export { interceptCompilationHooks, interceptCompilerHooks, shouldInterceptPluginHook };
@@ -0,0 +1,36 @@
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
+ Build: ()=>index_cjs_namespaceObject
28
+ });
29
+ const index_cjs_namespaceObject = require("./build/index.cjs");
30
+ exports.Build = __webpack_exports__.Build;
31
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
32
+ "Build"
33
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
34
+ Object.defineProperty(exports, '__esModule', {
35
+ value: true
36
+ });
@@ -1,3 +1 @@
1
1
  export * as Build from './build';
2
- export * as Common from './common';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,40 +1,4 @@
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
- Common: ()=>external_common_index_js_namespaceObject,
28
- Build: ()=>index_js_namespaceObject
29
- });
30
- const index_js_namespaceObject = require("./build/index.js");
31
- const external_common_index_js_namespaceObject = require("./common/index.js");
32
- exports.Build = __webpack_exports__.Build;
33
- exports.Common = __webpack_exports__.Common;
34
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
35
- "Build",
36
- "Common"
37
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
38
- Object.defineProperty(exports, '__esModule', {
39
- value: true
40
- });
1
+ import 'module';
2
+ /*#__PURE__*/ import.meta.url;
3
+ import * as __WEBPACK_EXTERNAL_MODULE__build_index_js_0bf6183b__ from "./build/index.js";
4
+ export { __WEBPACK_EXTERNAL_MODULE__build_index_js_0bf6183b__ as Build };