@rsdoctor/core 0.0.0-next-20240620044732

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 (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/build-utils/build/chunks/assetsModules.d.ts +4 -0
  4. package/dist/build-utils/build/chunks/assetsModules.d.ts.map +1 -0
  5. package/dist/build-utils/build/chunks/assetsModules.js +36 -0
  6. package/dist/build-utils/build/chunks/chunkTransform.d.ts +5 -0
  7. package/dist/build-utils/build/chunks/chunkTransform.d.ts.map +1 -0
  8. package/dist/build-utils/build/chunks/chunkTransform.js +31 -0
  9. package/dist/build-utils/build/chunks/generateTileGraph.d.ts +11 -0
  10. package/dist/build-utils/build/chunks/generateTileGraph.d.ts.map +1 -0
  11. package/dist/build-utils/build/chunks/generateTileGraph.js +71 -0
  12. package/dist/build-utils/build/chunks/index.d.ts +4 -0
  13. package/dist/build-utils/build/chunks/index.d.ts.map +1 -0
  14. package/dist/build-utils/build/chunks/index.js +26 -0
  15. package/dist/build-utils/build/index.d.ts +5 -0
  16. package/dist/build-utils/build/index.d.ts.map +1 -0
  17. package/dist/build-utils/build/index.js +47 -0
  18. package/dist/build-utils/build/module-graph/index.d.ts +4 -0
  19. package/dist/build-utils/build/module-graph/index.d.ts.map +1 -0
  20. package/dist/build-utils/build/module-graph/index.js +26 -0
  21. package/dist/build-utils/build/module-graph/parser.d.ts +3 -0
  22. package/dist/build-utils/build/module-graph/parser.d.ts.map +1 -0
  23. package/dist/build-utils/build/module-graph/parser.js +44 -0
  24. package/dist/build-utils/build/module-graph/transform.d.ts +5 -0
  25. package/dist/build-utils/build/module-graph/transform.d.ts.map +1 -0
  26. package/dist/build-utils/build/module-graph/transform.js +37 -0
  27. package/dist/build-utils/build/module-graph/treeShaking.d.ts +4 -0
  28. package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +1 -0
  29. package/dist/build-utils/build/module-graph/treeShaking.js +132 -0
  30. package/dist/build-utils/build/module-graph/utils.d.ts +4 -0
  31. package/dist/build-utils/build/module-graph/utils.d.ts.map +1 -0
  32. package/dist/build-utils/build/module-graph/utils.js +113 -0
  33. package/dist/build-utils/build/module-graph/webpack/transform.d.ts +12 -0
  34. package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +1 -0
  35. package/dist/build-utils/build/module-graph/webpack/transform.js +195 -0
  36. package/dist/build-utils/build/utils/index.d.ts +4 -0
  37. package/dist/build-utils/build/utils/index.d.ts.map +1 -0
  38. package/dist/build-utils/build/utils/index.js +26 -0
  39. package/dist/build-utils/build/utils/loader.d.ts +19 -0
  40. package/dist/build-utils/build/utils/loader.d.ts.map +1 -0
  41. package/dist/build-utils/build/utils/loader.js +299 -0
  42. package/dist/build-utils/build/utils/parseBundle.d.ts +13 -0
  43. package/dist/build-utils/build/utils/parseBundle.d.ts.map +1 -0
  44. package/dist/build-utils/build/utils/parseBundle.js +367 -0
  45. package/dist/build-utils/build/utils/plugin.d.ts +6 -0
  46. package/dist/build-utils/build/utils/plugin.d.ts.map +1 -0
  47. package/dist/build-utils/build/utils/plugin.js +63 -0
  48. package/dist/build-utils/common/chunks/assetsContent.d.ts +5 -0
  49. package/dist/build-utils/common/chunks/assetsContent.d.ts.map +1 -0
  50. package/dist/build-utils/common/chunks/assetsContent.js +34 -0
  51. package/dist/build-utils/common/chunks/assetsModules.d.ts +24 -0
  52. package/dist/build-utils/common/chunks/assetsModules.d.ts.map +1 -0
  53. package/dist/build-utils/common/chunks/assetsModules.js +107 -0
  54. package/dist/build-utils/common/chunks/chunkTransform.d.ts +6 -0
  55. package/dist/build-utils/common/chunks/chunkTransform.d.ts.map +1 -0
  56. package/dist/build-utils/common/chunks/chunkTransform.js +73 -0
  57. package/dist/build-utils/common/chunks/index.d.ts +4 -0
  58. package/dist/build-utils/common/chunks/index.d.ts.map +1 -0
  59. package/dist/build-utils/common/chunks/index.js +26 -0
  60. package/dist/build-utils/common/index.d.ts +6 -0
  61. package/dist/build-utils/common/index.d.ts.map +1 -0
  62. package/dist/build-utils/common/index.js +50 -0
  63. package/dist/build-utils/common/module-graph/compatible.d.ts +10 -0
  64. package/dist/build-utils/common/module-graph/compatible.d.ts.map +1 -0
  65. package/dist/build-utils/common/module-graph/compatible.js +63 -0
  66. package/dist/build-utils/common/module-graph/index.d.ts +4 -0
  67. package/dist/build-utils/common/module-graph/index.d.ts.map +1 -0
  68. package/dist/build-utils/common/module-graph/index.js +26 -0
  69. package/dist/build-utils/common/module-graph/transform.d.ts +8 -0
  70. package/dist/build-utils/common/module-graph/transform.d.ts.map +1 -0
  71. package/dist/build-utils/common/module-graph/transform.js +200 -0
  72. package/dist/build-utils/common/module-graph/utils.d.ts +16 -0
  73. package/dist/build-utils/common/module-graph/utils.d.ts.map +1 -0
  74. package/dist/build-utils/common/module-graph/utils.js +62 -0
  75. package/dist/build-utils/common/trans-utils/index.d.ts +2 -0
  76. package/dist/build-utils/common/trans-utils/index.d.ts.map +1 -0
  77. package/dist/build-utils/common/trans-utils/index.js +22 -0
  78. package/dist/build-utils/common/trans-utils/transStats.d.ts +7 -0
  79. package/dist/build-utils/common/trans-utils/transStats.d.ts.map +1 -0
  80. package/dist/build-utils/common/trans-utils/transStats.js +35 -0
  81. package/dist/build-utils/common/webpack/compatible.d.ts +27 -0
  82. package/dist/build-utils/common/webpack/compatible.d.ts.map +1 -0
  83. package/dist/build-utils/common/webpack/compatible.js +181 -0
  84. package/dist/build-utils/index.d.ts +3 -0
  85. package/dist/build-utils/index.d.ts.map +1 -0
  86. package/dist/build-utils/index.js +41 -0
  87. package/dist/index.d.ts +4 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +43 -0
  90. package/dist/inner-plugins/constants.d.ts +7 -0
  91. package/dist/inner-plugins/constants.d.ts.map +1 -0
  92. package/dist/inner-plugins/constants.js +52 -0
  93. package/dist/inner-plugins/index.d.ts +3 -0
  94. package/dist/inner-plugins/index.d.ts.map +1 -0
  95. package/dist/inner-plugins/index.js +24 -0
  96. package/dist/inner-plugins/loaders/proxy.d.ts +5 -0
  97. package/dist/inner-plugins/loaders/proxy.d.ts.map +1 -0
  98. package/dist/inner-plugins/loaders/proxy.js +115 -0
  99. package/dist/inner-plugins/plugins/base.d.ts +14 -0
  100. package/dist/inner-plugins/plugins/base.d.ts.map +1 -0
  101. package/dist/inner-plugins/plugins/base.js +45 -0
  102. package/dist/inner-plugins/plugins/bundle.d.ts +15 -0
  103. package/dist/inner-plugins/plugins/bundle.d.ts.map +1 -0
  104. package/dist/inner-plugins/plugins/bundle.js +92 -0
  105. package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +7 -0
  106. package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts.map +1 -0
  107. package/dist/inner-plugins/plugins/bundleTagPlugin.js +81 -0
  108. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +10 -0
  109. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +1 -0
  110. package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +126 -0
  111. package/dist/inner-plugins/plugins/errors.d.ts +12 -0
  112. package/dist/inner-plugins/plugins/errors.d.ts.map +1 -0
  113. package/dist/inner-plugins/plugins/errors.js +85 -0
  114. package/dist/inner-plugins/plugins/index.d.ts +11 -0
  115. package/dist/inner-plugins/plugins/index.d.ts.map +1 -0
  116. package/dist/inner-plugins/plugins/index.js +40 -0
  117. package/dist/inner-plugins/plugins/loader.d.ts +12 -0
  118. package/dist/inner-plugins/plugins/loader.d.ts.map +1 -0
  119. package/dist/inner-plugins/plugins/loader.js +161 -0
  120. package/dist/inner-plugins/plugins/plugins.d.ts +9 -0
  121. package/dist/inner-plugins/plugins/plugins.d.ts.map +1 -0
  122. package/dist/inner-plugins/plugins/plugins.js +60 -0
  123. package/dist/inner-plugins/plugins/progress.d.ts +9 -0
  124. package/dist/inner-plugins/plugins/progress.d.ts.map +1 -0
  125. package/dist/inner-plugins/plugins/progress.js +59 -0
  126. package/dist/inner-plugins/plugins/rules.d.ts +9 -0
  127. package/dist/inner-plugins/plugins/rules.d.ts.map +1 -0
  128. package/dist/inner-plugins/plugins/rules.js +85 -0
  129. package/dist/inner-plugins/plugins/summary.d.ts +15 -0
  130. package/dist/inner-plugins/plugins/summary.d.ts.map +1 -0
  131. package/dist/inner-plugins/plugins/summary.js +115 -0
  132. package/dist/inner-plugins/utils/circleDetect.d.ts +5 -0
  133. package/dist/inner-plugins/utils/circleDetect.d.ts.map +1 -0
  134. package/dist/inner-plugins/utils/circleDetect.js +42 -0
  135. package/dist/inner-plugins/utils/config.d.ts +8 -0
  136. package/dist/inner-plugins/utils/config.d.ts.map +1 -0
  137. package/dist/inner-plugins/utils/config.js +151 -0
  138. package/dist/inner-plugins/utils/index.d.ts +6 -0
  139. package/dist/inner-plugins/utils/index.d.ts.map +1 -0
  140. package/dist/inner-plugins/utils/index.js +30 -0
  141. package/dist/inner-plugins/utils/loader.d.ts +12 -0
  142. package/dist/inner-plugins/utils/loader.d.ts.map +1 -0
  143. package/dist/inner-plugins/utils/loader.js +201 -0
  144. package/dist/inner-plugins/utils/plugin.d.ts +6 -0
  145. package/dist/inner-plugins/utils/plugin.d.ts.map +1 -0
  146. package/dist/inner-plugins/utils/plugin.js +126 -0
  147. package/dist/inner-plugins/utils/sdk.d.ts +4 -0
  148. package/dist/inner-plugins/utils/sdk.d.ts.map +1 -0
  149. package/dist/inner-plugins/utils/sdk.js +43 -0
  150. package/dist/rules/index.d.ts +4 -0
  151. package/dist/rules/index.d.ts.map +1 -0
  152. package/dist/rules/index.js +33 -0
  153. package/dist/rules/linter.d.ts +10 -0
  154. package/dist/rules/linter.d.ts.map +1 -0
  155. package/dist/rules/linter.js +74 -0
  156. package/dist/rules/rule.d.ts +28 -0
  157. package/dist/rules/rule.d.ts.map +1 -0
  158. package/dist/rules/rule.js +143 -0
  159. package/dist/rules/rules/default-import-check/index.d.ts +5 -0
  160. package/dist/rules/rules/default-import-check/index.d.ts.map +1 -0
  161. package/dist/rules/rules/default-import-check/index.js +124 -0
  162. package/dist/rules/rules/default-import-check/types.d.ts +5 -0
  163. package/dist/rules/rules/default-import-check/types.d.ts.map +1 -0
  164. package/dist/rules/rules/default-import-check/types.js +16 -0
  165. package/dist/rules/rules/default-import-check/utils.d.ts +11 -0
  166. package/dist/rules/rules/default-import-check/utils.d.ts.map +1 -0
  167. package/dist/rules/rules/default-import-check/utils.js +93 -0
  168. package/dist/rules/rules/duplicate-package/index.d.ts +5 -0
  169. package/dist/rules/rules/duplicate-package/index.d.ts.map +1 -0
  170. package/dist/rules/rules/duplicate-package/index.js +71 -0
  171. package/dist/rules/rules/duplicate-package/types.d.ts +25 -0
  172. package/dist/rules/rules/duplicate-package/types.d.ts.map +1 -0
  173. package/dist/rules/rules/duplicate-package/types.js +51 -0
  174. package/dist/rules/rules/duplicate-package/utils.d.ts +4 -0
  175. package/dist/rules/rules/duplicate-package/utils.d.ts.map +1 -0
  176. package/dist/rules/rules/duplicate-package/utils.js +89 -0
  177. package/dist/rules/rules/ecma-version-check/index.d.ts +5 -0
  178. package/dist/rules/rules/ecma-version-check/index.d.ts.map +1 -0
  179. package/dist/rules/rules/ecma-version-check/index.js +82 -0
  180. package/dist/rules/rules/ecma-version-check/types.d.ts +8 -0
  181. package/dist/rules/rules/ecma-version-check/types.d.ts.map +1 -0
  182. package/dist/rules/rules/ecma-version-check/types.js +16 -0
  183. package/dist/rules/rules/ecma-version-check/utils.d.ts +3 -0
  184. package/dist/rules/rules/ecma-version-check/utils.d.ts.map +1 -0
  185. package/dist/rules/rules/ecma-version-check/utils.js +31 -0
  186. package/dist/rules/rules/index.d.ts +2 -0
  187. package/dist/rules/rules/index.d.ts.map +1 -0
  188. package/dist/rules/rules/index.js +37 -0
  189. package/dist/rules/rules/loader-performance-optimization/index.d.ts +5 -0
  190. package/dist/rules/rules/loader-performance-optimization/index.d.ts.map +1 -0
  191. package/dist/rules/rules/loader-performance-optimization/index.js +124 -0
  192. package/dist/rules/rules/loader-performance-optimization/types.d.ts +23 -0
  193. package/dist/rules/rules/loader-performance-optimization/types.d.ts.map +1 -0
  194. package/dist/rules/rules/loader-performance-optimization/types.js +16 -0
  195. package/dist/rules/rules/loader-performance-optimization/utils.d.ts +2 -0
  196. package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +1 -0
  197. package/dist/rules/rules/loader-performance-optimization/utils.js +38 -0
  198. package/dist/rules/utils.d.ts +4 -0
  199. package/dist/rules/utils.d.ts.map +1 -0
  200. package/dist/rules/utils.js +44 -0
  201. package/dist/types/chunks.d.ts +12 -0
  202. package/dist/types/chunks.d.ts.map +1 -0
  203. package/dist/types/chunks.js +16 -0
  204. package/dist/types/index.d.ts +6 -0
  205. package/dist/types/index.d.ts.map +1 -0
  206. package/dist/types/index.js +30 -0
  207. package/dist/types/loader.d.ts +20 -0
  208. package/dist/types/loader.d.ts.map +1 -0
  209. package/dist/types/loader.js +16 -0
  210. package/dist/types/plugin.d.ts +96 -0
  211. package/dist/types/plugin.d.ts.map +1 -0
  212. package/dist/types/plugin.js +16 -0
  213. package/dist/types/rules.d.ts +8 -0
  214. package/dist/types/rules.d.ts.map +1 -0
  215. package/dist/types/rules.js +16 -0
  216. package/dist/types/webpack.d.ts +15 -0
  217. package/dist/types/webpack.d.ts.map +1 -0
  218. package/dist/types/webpack.js +16 -0
  219. package/package.json +112 -0
@@ -0,0 +1,13 @@
1
+ import { ParseBundle } from '../../../types';
2
+ /**
3
+ * The following code is based on
4
+ * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/src/parseUtils.js#L10
5
+ *
6
+ *
7
+ * MIT Licensed
8
+ * Author th0r
9
+ * Copyright JS Foundation and other contributors.
10
+ * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
11
+ */
12
+ export declare const parseBundle: ParseBundle;
13
+ //# sourceMappingURL=parseBundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseBundle.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/parseBundle.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC;;;;;;;;;GASG;AAEH,eAAO,MAAM,WAAW,EAAE,WA4PzB,CAAC"}
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var parseBundle_exports = {};
30
+ __export(parseBundle_exports, {
31
+ parseBundle: () => parseBundle
32
+ });
33
+ module.exports = __toCommonJS(parseBundle_exports);
34
+ var import_fs = __toESM(require("fs"));
35
+ var import_lodash = require("lodash");
36
+ var import_filesize = require("filesize");
37
+ var import_ruleUtils = require("@rsdoctor/utils/ruleUtils");
38
+ var import_path = require("path");
39
+ var import_logger = require("@rsdoctor/utils/logger");
40
+ const parseBundle = (bundlePath, modulesData) => {
41
+ if (bundlePath.indexOf(".worker.") > 0) {
42
+ return {};
43
+ }
44
+ if ((0, import_path.extname)(bundlePath) !== ".js") {
45
+ return {};
46
+ }
47
+ let content = import_fs.default.readFileSync(bundlePath, "utf8");
48
+ const tagCache = /* @__PURE__ */ new Map();
49
+ let hasBannerPlugin = content.indexOf("RSDOCTOR_START::") > 0;
50
+ if (hasBannerPlugin && !tagCache.get(bundlePath)) {
51
+ const tagMatchResult = getStringBetween(
52
+ content,
53
+ 0,
54
+ /([a-z|A-Z]+\.[a-z]+)\(\SRSDOCTOR_START::(.*?);/,
55
+ /([a-z|A-Z]+\.[a-z]+)\(\SRSDOCTOR_END::(.*?)\)/
56
+ );
57
+ content = tagMatchResult.result?.trim() || content;
58
+ tagCache.set(bundlePath, tagMatchResult.loc);
59
+ hasBannerPlugin = true;
60
+ } else if (hasBannerPlugin && !tagCache.get(bundlePath)) {
61
+ const loc = tagCache.get(bundlePath);
62
+ content = content.slice(loc.start, loc.end);
63
+ hasBannerPlugin = true;
64
+ }
65
+ const ast = import_ruleUtils.parser.internal.parse(content, {
66
+ sourceType: "script",
67
+ ecmaVersion: "latest"
68
+ });
69
+ const walkState = {
70
+ locations: null,
71
+ expressionStatementDepth: 0
72
+ };
73
+ import_ruleUtils.parser.walk.recursive(ast, walkState, {
74
+ ExpressionStatement(node, state, c) {
75
+ if (state.locations)
76
+ return;
77
+ state.expressionStatementDepth++;
78
+ try {
79
+ if (
80
+ // Webpack 5 stores modules in the the top-level IIFE
81
+ state.expressionStatementDepth === 1 && // ast?.range?.includes(node) &&
82
+ isIIFE(node)
83
+ ) {
84
+ const fn = getIIFECallExpression(node);
85
+ if (
86
+ // It should not contain neither arguments
87
+ fn.arguments.length === 0 && // ...nor parameters
88
+ fn.callee.params.length === 0
89
+ ) {
90
+ const firstVariableDeclaration = fn.callee.body.body.find(
91
+ (node2) => node2.type === "VariableDeclaration"
92
+ );
93
+ if (firstVariableDeclaration) {
94
+ for (const declaration of firstVariableDeclaration.declarations) {
95
+ if (declaration.init) {
96
+ state.locations = getModulesLocations(declaration.init);
97
+ if (state.locations) {
98
+ break;
99
+ }
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ if (!state.locations) {
106
+ c(node.expression, state);
107
+ }
108
+ } catch (e) {
109
+ (0, import_logger.debug)(() => e);
110
+ }
111
+ state.expressionStatementDepth--;
112
+ },
113
+ Program(node, state, _c) {
114
+ if (state.locations)
115
+ return;
116
+ try {
117
+ if (hasBannerPlugin) {
118
+ const firstVariableDeclaration = node.body.find(
119
+ (node2) => {
120
+ return node2.type === "VariableDeclaration" && node2.declarations?.[0]?.init?.type === "ObjectExpression" && node2.declarations?.[0]?.init?.properties?.length;
121
+ }
122
+ );
123
+ if (firstVariableDeclaration) {
124
+ for (const declaration of firstVariableDeclaration.declarations) {
125
+ if (declaration.init) {
126
+ state.locations = getModulesLocations(declaration.init);
127
+ if (state.locations) {
128
+ break;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
134
+ if (!state.locations) {
135
+ node.body.forEach((n) => _c(n, state));
136
+ }
137
+ } catch (e) {
138
+ (0, import_logger.debug)(() => e);
139
+ }
140
+ state.expressionStatementDepth--;
141
+ },
142
+ AssignmentExpression(node, state) {
143
+ if (state.locations)
144
+ return;
145
+ const { left, right } = node;
146
+ if (left?.object && left.object.name === "exports" && left.property && left.property.name === "modules" && isModulesHash(right)) {
147
+ state.locations = getModulesLocations(right);
148
+ }
149
+ },
150
+ CallExpression(node, state, c) {
151
+ if (state.locations)
152
+ return;
153
+ const args = node.arguments;
154
+ if (node.callee.type === "FunctionExpression" && !node.callee.id && args.length === 1 && isSimpleModulesList(args[0])) {
155
+ state.locations = getModulesLocations(args[0]);
156
+ return;
157
+ }
158
+ if (node.callee.type === "Identifier" && mayBeAsyncChunkArguments(args) && isModulesList(args[1])) {
159
+ state.locations = getModulesLocations(args[1]);
160
+ return;
161
+ }
162
+ if (isAsyncChunkPushExpression(node)) {
163
+ state.locations = getModulesLocations(args[0].elements[1]);
164
+ return;
165
+ }
166
+ if (isAsyncWebWorkerChunkExpression(node)) {
167
+ state.locations = getModulesLocations(args[1]);
168
+ return;
169
+ }
170
+ args.forEach((arg) => c(arg, state));
171
+ }
172
+ });
173
+ let modules;
174
+ if (walkState.locations) {
175
+ modules = (0, import_lodash.mapValues)(
176
+ walkState.locations,
177
+ (loc) => content.slice(loc.start, loc.end)
178
+ );
179
+ } else {
180
+ modules = {};
181
+ }
182
+ const modulesObj = {};
183
+ for (const module2 in modules) {
184
+ if (!module2) {
185
+ return {};
186
+ }
187
+ const moduleContent = modules[module2];
188
+ const size = moduleContent && Buffer.byteLength(moduleContent);
189
+ const _filterModules = (0, import_lodash.find)(modulesData, {
190
+ id: Number(module2)
191
+ });
192
+ const identifier = _filterModules?.identifier || (0, import_lodash.find)(modulesData, { id: module2 })?.identifier || "";
193
+ modulesObj[identifier] = {
194
+ size,
195
+ sizeConvert: (0, import_filesize.filesize)(size || 0),
196
+ content: moduleContent
197
+ };
198
+ }
199
+ return {
200
+ modules: modulesObj,
201
+ src: content,
202
+ runtimeSrc: getBundleRuntime(content, walkState.locations)
203
+ };
204
+ };
205
+ function getBundleRuntime(content, modulesLocations) {
206
+ const sortedLocations = Object.values(modulesLocations || {}).sort(
207
+ (a, b) => a.start - b.start
208
+ );
209
+ let result = "";
210
+ let lastIndex = 0;
211
+ for (const { start, end } of sortedLocations) {
212
+ result += content.slice(lastIndex, start);
213
+ lastIndex = end;
214
+ }
215
+ return result + content.slice(lastIndex, content.length);
216
+ }
217
+ function isIIFE(node) {
218
+ return node.type === "ExpressionStatement" && (node.expression.type === "CallExpression" || node.expression.type === "UnaryExpression" && node.expression.argument.type === "CallExpression");
219
+ }
220
+ function getIIFECallExpression(node) {
221
+ if (node.expression.type === "UnaryExpression") {
222
+ return node.expression.argument;
223
+ }
224
+ return node.expression;
225
+ }
226
+ function isModulesList(node) {
227
+ return isSimpleModulesList(node) || // Modules are contained in expression `Array([minimum ID]).concat([<module>, <module>, ...])`
228
+ isOptimizedModulesArray(node);
229
+ }
230
+ function isSimpleModulesList(node) {
231
+ return (
232
+ // Modules are contained in hash. Keys are module ids.
233
+ isModulesHash(node) || // Modules are contained in array. Indexes are module ids.
234
+ isModulesArray(node)
235
+ );
236
+ }
237
+ function isModulesHash(node) {
238
+ return node.type === "ObjectExpression" && node.properties.map((node2) => node2.value).every(isModuleWrapper);
239
+ }
240
+ function isModulesArray(node) {
241
+ return node.type === "ArrayExpression" && node.elements.every(
242
+ (elem) => (
243
+ // Some of array items may be skipped because there is no module with such id
244
+ !elem || isModuleWrapper(elem)
245
+ )
246
+ );
247
+ }
248
+ function isOptimizedModulesArray(node) {
249
+ return node.type === "CallExpression" && node.callee.type === "MemberExpression" && // Make sure the object called is `Array(<some number>)`
250
+ node.callee.object.type === "CallExpression" && node.callee.object.callee.type === "Identifier" && node.callee.object.callee.name === "Array" && node.callee.object.arguments.length === 1 && isNumericId(node.callee.object.arguments[0]) && // Make sure the property X called for `Array(<some number>).X` is `concat`
251
+ node.callee.property.type === "Identifier" && node.callee.property.name === "concat" && // Make sure exactly one array is passed in to `concat`
252
+ node.arguments.length === 1 && isModulesArray(node.arguments[0]);
253
+ }
254
+ function isModuleWrapper(node) {
255
+ return (
256
+ // It's an anonymous function expression that wraps module
257
+ (node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression") && !node.id || // If `DedupePlugin` is used it can be an ID of duplicated module...
258
+ isModuleId(node) || // or an array of shape [<module_id>, ...args]
259
+ node.type === "ArrayExpression" && node.elements.length > 1 && isModuleId(node.elements[0])
260
+ );
261
+ }
262
+ function isModuleId(node) {
263
+ return node.type === "Literal" && (isNumericId(node) || typeof node.value === "string");
264
+ }
265
+ function isNumericId(node) {
266
+ return node.type === "Literal" && Number.isInteger(node.value) && node.value >= 0;
267
+ }
268
+ function isChunkIds(node) {
269
+ return node.type === "ArrayExpression" && node.elements.every(isModuleId);
270
+ }
271
+ function isAsyncChunkPushExpression(node) {
272
+ const { callee, arguments: args } = node;
273
+ return callee.type === "MemberExpression" && callee.property.name === "push" && callee.object.type === "AssignmentExpression" && args.length === 1 && args[0].type === "ArrayExpression" && mayBeAsyncChunkArguments(args[0].elements) && isModulesList(args[0].elements[1]);
274
+ }
275
+ function mayBeAsyncChunkArguments(args) {
276
+ return args.length >= 2 && isChunkIds(args[0]);
277
+ }
278
+ function isAsyncWebWorkerChunkExpression(node) {
279
+ const { callee, type, arguments: args } = node;
280
+ return type === "CallExpression" && callee.type === "MemberExpression" && args.length === 2 && isChunkIds(args[0]) && isModulesList(args[1]);
281
+ }
282
+ function getModulesLocations(node) {
283
+ if (node.type === "ObjectExpression") {
284
+ const modulesNodes = node.properties;
285
+ return modulesNodes.reduce(
286
+ (result, moduleNode) => {
287
+ const moduleId = moduleNode.key.name || moduleNode.key.value;
288
+ result[moduleId] = getModuleLocation(moduleNode.value);
289
+ return result;
290
+ },
291
+ {}
292
+ );
293
+ }
294
+ const isOptimizedArray = node.type === "CallExpression";
295
+ if (node.type === "ArrayExpression" || isOptimizedArray) {
296
+ const minId = isOptimizedArray ? (
297
+ // Get the [minId] value from the Array() call first argument literal value
298
+ node.callee.object.arguments[0].value
299
+ ) : (
300
+ // `0` for simple array
301
+ 0
302
+ );
303
+ const modulesNodes = isOptimizedArray ? (
304
+ // The modules reside in the `concat()` function call arguments
305
+ node.arguments[0].elements
306
+ ) : node.elements;
307
+ return modulesNodes.reduce(
308
+ (result, moduleNode, i) => {
309
+ if (moduleNode) {
310
+ result[i + minId] = getModuleLocation(moduleNode);
311
+ }
312
+ return result;
313
+ },
314
+ {}
315
+ );
316
+ }
317
+ return {};
318
+ }
319
+ function getModuleLocation(node) {
320
+ return {
321
+ start: node.start,
322
+ end: node.end
323
+ };
324
+ }
325
+ function getStringBetween(raw, position, start, end) {
326
+ try {
327
+ const matchStart = raw.match(start);
328
+ const startFlagIndex = matchStart?.length ? raw.indexOf(matchStart[0], position) : -1;
329
+ if (startFlagIndex === -1 || !matchStart?.length) {
330
+ return {
331
+ result: null,
332
+ remain: position
333
+ };
334
+ }
335
+ const startTagLength = matchStart[0].length;
336
+ const matchEnd = raw.match(end);
337
+ const endFlagIndex = matchEnd?.length ? raw.indexOf(matchEnd[0], startFlagIndex + startTagLength) : -1;
338
+ if (endFlagIndex === -1 || !matchEnd?.length) {
339
+ return {
340
+ result: null,
341
+ remain: position
342
+ };
343
+ }
344
+ let innerContent = raw.slice(startFlagIndex + startTagLength, endFlagIndex).trim();
345
+ if (innerContent.endsWith(",")) {
346
+ innerContent = innerContent.slice(0, -1);
347
+ }
348
+ return {
349
+ result: innerContent,
350
+ remain: matchEnd?.length ? endFlagIndex + matchEnd[0].length : endFlagIndex,
351
+ loc: {
352
+ start: startFlagIndex + startTagLength,
353
+ end: endFlagIndex
354
+ }
355
+ };
356
+ } catch (e) {
357
+ (0, import_logger.debug)(() => e);
358
+ return {
359
+ result: null,
360
+ remain: position
361
+ };
362
+ }
363
+ }
364
+ // Annotate the CommonJS export names for ESM import in node:
365
+ 0 && (module.exports = {
366
+ parseBundle
367
+ });
@@ -0,0 +1,6 @@
1
+ import { Plugin } from '@rsdoctor/types';
2
+ export type IHook = Plugin.BaseCompiler['hooks'][keyof Plugin.BaseCompiler['hooks']];
3
+ export declare function shouldInterceptPluginHook<T extends IHook>(hook: T): boolean;
4
+ export declare function interceptCompilerHooks(compiler: Plugin.BaseCompiler, interceptor: (name: string, hook: IHook, scope: 'compiler') => void): void;
5
+ export declare function interceptCompilationHooks(compilation: Plugin.BaseCompilation, interceptor: (name: string, hook: IHook, scope: 'compilation') => void): void;
6
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/build/utils/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,KAAK,GACf,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnE,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,KAAK,EAAE,IAAI,EAAE,CAAC,WAoBjE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,CAAC,YAAY,EAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,KAAK,IAAI,QAQpE;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,CAAC,eAAe,EACnC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,QAiBvE"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var plugin_exports = {};
20
+ __export(plugin_exports, {
21
+ interceptCompilationHooks: () => interceptCompilationHooks,
22
+ interceptCompilerHooks: () => interceptCompilerHooks,
23
+ shouldInterceptPluginHook: () => shouldInterceptPluginHook
24
+ });
25
+ module.exports = __toCommonJS(plugin_exports);
26
+ var import_compatible = require("../../common/module-graph/compatible");
27
+ function shouldInterceptPluginHook(hook) {
28
+ if (hook._fakeHook) {
29
+ return false;
30
+ }
31
+ if (typeof hook.isUsed === "function") {
32
+ return hook.isUsed();
33
+ }
34
+ if (hook._map && hook._map.size === 0) {
35
+ return false;
36
+ }
37
+ return true;
38
+ }
39
+ function interceptCompilerHooks(compiler, interceptor) {
40
+ Object.keys(compiler.hooks).forEach((hook) => {
41
+ const v = compiler.hooks[hook];
42
+ if (shouldInterceptPluginHook(v)) {
43
+ interceptor(hook, v, "compiler");
44
+ }
45
+ });
46
+ }
47
+ function interceptCompilationHooks(compilation, interceptor) {
48
+ Object.keys(compilation.hooks).forEach((hook) => {
49
+ if (hook === "normalModuleLoader" && (0, import_compatible.isWebpack5orRspack)(compilation)) {
50
+ return;
51
+ }
52
+ const v = compilation.hooks[hook];
53
+ if (shouldInterceptPluginHook(v)) {
54
+ interceptor(hook, v, "compilation");
55
+ }
56
+ });
57
+ }
58
+ // Annotate the CommonJS export names for ESM import in node:
59
+ 0 && (module.exports = {
60
+ interceptCompilationHooks,
61
+ interceptCompilerHooks,
62
+ shouldInterceptPluginHook
63
+ });
@@ -0,0 +1,5 @@
1
+ import { ChunkGraph } from '@rsdoctor/graph';
2
+ export declare function assetsContents(assetMap: Map<string, {
3
+ content: string;
4
+ }>, chunkGraph: ChunkGraph): void;
5
+ //# sourceMappingURL=assetsContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetsContent.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,UAAU,EAAE,UAAU,QAOvB"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var assetsContent_exports = {};
20
+ __export(assetsContent_exports, {
21
+ assetsContents: () => assetsContents
22
+ });
23
+ module.exports = __toCommonJS(assetsContent_exports);
24
+ function assetsContents(assetMap, chunkGraph) {
25
+ const assets = chunkGraph.getAssets();
26
+ assets.forEach((asset) => {
27
+ const { content = "" } = assetMap.get(asset.path) || {};
28
+ asset.content = content;
29
+ });
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ assetsContents
34
+ });
@@ -0,0 +1,24 @@
1
+ import { Plugin } from '@rsdoctor/types';
2
+ import type { ModuleGraph } from '@rsdoctor/graph';
3
+ import { ParseBundle } from '../../../types';
4
+ export type ParsedModuleSizeData = {
5
+ [x: string]: {
6
+ size: number;
7
+ sizeConvert: string;
8
+ content: string;
9
+ };
10
+ };
11
+ /**
12
+ * The following code is modified based on
13
+ * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/8a3d3f0f40010f2b41ccd28519eda5a44e13da3e/src/analyzer.js#L20
14
+ *
15
+ * MIT Licensed
16
+ * Author th0r
17
+ * Copyright JS Foundation and other contributors.
18
+ * https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/44bd8d0f9aa3b098e271af220096ea70cc44bc9e/LICENSE
19
+ */
20
+ export declare function getAssetsModulesData(bundleStats: Plugin.StatsCompilation, bundleDir: string, opts: {
21
+ parseBundle?: ParseBundle;
22
+ }): Promise<ParsedModuleSizeData | null>;
23
+ export declare function transformAssetsModulesData(parsedModulesData: ParsedModuleSizeData, moduleGraph: ModuleGraph): void;
24
+ //# sourceMappingURL=assetsModules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetsModules.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/assetsModules.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACrE,CAAC;AACF;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,CAAC,gBAAgB,EACpC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;IACJ,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,GACA,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAsEtC;AAED,wBAAgB,0BAA0B,CACxC,iBAAiB,EAAE,oBAAoB,EACvC,WAAW,EAAE,WAAW,QAUzB"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var assetsModules_exports = {};
30
+ __export(assetsModules_exports, {
31
+ getAssetsModulesData: () => getAssetsModulesData,
32
+ transformAssetsModulesData: () => transformAssetsModulesData
33
+ });
34
+ module.exports = __toCommonJS(assetsModules_exports);
35
+ var import_lodash = require("lodash");
36
+ var import_path = __toESM(require("path"));
37
+ var import_logger = require("@rsdoctor/utils/logger");
38
+ var import_module_graph = require("../module-graph");
39
+ async function getAssetsModulesData(bundleStats, bundleDir, opts) {
40
+ const { parseBundle = () => ({}) } = opts || {};
41
+ if ((0, import_lodash.isEmpty)(bundleStats.assets) && !(0, import_lodash.isEmpty)(bundleStats.children)) {
42
+ const { children } = bundleStats;
43
+ const _bundleStats = children?.[0];
44
+ if (!children) {
45
+ return {};
46
+ }
47
+ for (let i = 1; i < children.length; i++) {
48
+ children[i]?.assets?.forEach((asset) => {
49
+ _bundleStats?.assets?.push(asset);
50
+ });
51
+ }
52
+ } else if (!(0, import_lodash.isEmpty)(bundleStats.children)) {
53
+ bundleStats?.children?.forEach((child) => {
54
+ child?.assets?.forEach((asset) => {
55
+ bundleStats?.assets?.push(asset);
56
+ });
57
+ });
58
+ }
59
+ let bundlesSources = null;
60
+ let parsedModules = null;
61
+ if (bundleDir && bundleStats?.assets) {
62
+ bundlesSources = {};
63
+ parsedModules = {};
64
+ for (const statAsset of bundleStats.assets) {
65
+ const assetFile = import_path.default.join(bundleDir, statAsset.name);
66
+ let bundleInfo;
67
+ const collectedModules = [];
68
+ (0, import_module_graph.getModulesFromArray)(bundleStats.modules ?? [], collectedModules);
69
+ const childrenModules = bundleStats.children?.flatMap((c) => c.modules || []) || [];
70
+ collectedModules.push(...childrenModules);
71
+ try {
72
+ bundleInfo = await parseBundle(assetFile, collectedModules);
73
+ } catch (err) {
74
+ const { code = "", message } = err;
75
+ const msg = code === "ENOENT" ? "no such file" : message;
76
+ process.env.DEVTOOLS_NODE_DEV === "1" && import_logger.logger.warn(`Error parsing bundle asset "${assetFile}": ${msg}`);
77
+ continue;
78
+ }
79
+ bundlesSources[statAsset.name] = (0, import_lodash.pick)(bundleInfo, "src", "runtimeSrc");
80
+ Object.assign(parsedModules, bundleInfo?.modules || {});
81
+ }
82
+ if ((0, import_lodash.isEmpty)(bundlesSources)) {
83
+ bundlesSources = null;
84
+ parsedModules = null;
85
+ process.env.DEVTOOLS_DEV && import_logger.logger.warn(
86
+ "\nNo bundles were parsed. Analyzer will show only original module sizes from stats file.\n"
87
+ );
88
+ }
89
+ }
90
+ return parsedModules;
91
+ }
92
+ function transformAssetsModulesData(parsedModulesData, moduleGraph) {
93
+ if (!moduleGraph)
94
+ return;
95
+ Object.entries(parsedModulesData).forEach(([moduleId, parsedData]) => {
96
+ const module2 = moduleGraph.getModuleByWebpackId(moduleId ?? "");
97
+ module2?.setSize({
98
+ parsedSize: parsedData?.size
99
+ });
100
+ module2?.setSource({ parsedSource: parsedData?.content || "" });
101
+ });
102
+ }
103
+ // Annotate the CommonJS export names for ESM import in node:
104
+ 0 && (module.exports = {
105
+ getAssetsModulesData,
106
+ transformAssetsModulesData
107
+ });
@@ -0,0 +1,6 @@
1
+ import { ChunkGraph } from '@rsdoctor/graph';
2
+ import { Plugin } from '@rsdoctor/types';
3
+ export declare function chunkTransform(assetMap: Map<string, {
4
+ content: string;
5
+ }>, bundleStats: Plugin.StatsCompilation): ChunkGraph;
6
+ //# sourceMappingURL=chunkTransform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunkTransform.d.ts","sourceRoot":"","sources":["../../../../src/build-utils/common/chunks/chunkTransform.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EAC1C,WAAW,EAAE,MAAM,CAAC,gBAAgB,cA0DrC"}