@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.
- package/dist/build-utils/{common/trans-utils/transStats.js → build/chunks/assetsModules.cjs} +9 -12
- package/dist/build-utils/build/chunks/assetsModules.d.ts +0 -1
- package/dist/build-utils/build/chunks/assetsModules.js +7 -39
- package/dist/build-utils/build/chunks/chunkTransform.cjs +39 -0
- package/dist/build-utils/build/chunks/chunkTransform.d.ts +0 -1
- package/dist/build-utils/build/chunks/chunkTransform.js +5 -37
- package/dist/build-utils/{common/chunks/index.js → build/chunks/index.cjs} +8 -8
- package/dist/build-utils/build/chunks/index.d.ts +0 -1
- package/dist/build-utils/build/chunks/index.js +5 -78
- package/dist/build-utils/build/chunks/rspack/transform.cjs +80 -0
- package/dist/build-utils/build/chunks/rspack/transform.d.ts +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.js +7 -42
- package/dist/build-utils/{common/index.js → build/index.cjs} +14 -14
- package/dist/build-utils/build/index.d.ts +0 -1
- package/dist/build-utils/build/index.js +8 -52
- package/dist/build-utils/build/loader/index.cjs +69 -0
- package/dist/build-utils/build/loader/index.d.ts +1 -1
- package/dist/build-utils/build/loader/index.js +4 -60
- package/dist/build-utils/build/loader/probeLoader.cjs +90 -0
- package/dist/build-utils/build/loader/probeLoader.d.ts +0 -1
- package/dist/build-utils/build/loader/probeLoader.js +12 -57
- package/dist/build-utils/build/loader/probeLoaderPlugin.cjs +65 -0
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts +0 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.js +11 -43
- package/dist/build-utils/build/module-graph/index.cjs +87 -0
- package/dist/build-utils/build/module-graph/index.d.ts +0 -1
- package/dist/build-utils/build/module-graph/index.js +6 -87
- package/dist/build-utils/build/module-graph/parser.cjs +46 -0
- package/dist/build-utils/build/module-graph/parser.d.ts +0 -1
- package/dist/build-utils/build/module-graph/parser.js +7 -39
- package/dist/build-utils/build/module-graph/rspack/transform.cjs +110 -0
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/rspack/transform.js +12 -50
- package/dist/build-utils/build/module-graph/transform.cjs +40 -0
- package/dist/build-utils/build/module-graph/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/transform.js +6 -38
- package/dist/build-utils/build/module-graph/treeShaking.cjs +107 -0
- package/dist/build-utils/build/module-graph/treeShaking.d.ts +0 -1
- package/dist/build-utils/build/module-graph/treeShaking.js +15 -49
- package/dist/build-utils/build/module-graph/utils.cjs +97 -0
- package/dist/build-utils/build/module-graph/utils.d.ts +0 -1
- package/dist/build-utils/build/module-graph/utils.js +15 -50
- package/dist/build-utils/build/module-graph/webpack/transform.cjs +171 -0
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts +0 -1
- package/dist/build-utils/build/module-graph/webpack/transform.js +31 -57
- package/dist/build-utils/{common/module-graph/index.js → build/utils/index.cjs} +15 -15
- package/dist/build-utils/build/utils/index.d.ts +0 -2
- package/dist/build-utils/build/utils/index.js +5 -87
- package/dist/build-utils/build/utils/loader.cjs +356 -0
- package/dist/build-utils/build/utils/loader.d.ts +1 -3
- package/dist/build-utils/build/utils/loader.js +44 -90
- package/dist/build-utils/build/utils/parseBundle.cjs +284 -0
- package/dist/build-utils/build/utils/parseBundle.d.ts +1 -2
- package/dist/build-utils/build/utils/parseBundle.js +19 -61
- package/dist/build-utils/build/utils/plugin.cjs +61 -0
- package/dist/build-utils/build/utils/plugin.d.ts +0 -1
- package/dist/build-utils/build/utils/plugin.js +5 -43
- package/dist/build-utils/index.cjs +36 -0
- package/dist/build-utils/index.d.ts +0 -2
- package/dist/build-utils/index.js +4 -40
- package/dist/index.cjs +85 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -85
- package/dist/inner-plugins/constants.cjs +64 -0
- package/dist/inner-plugins/constants.d.ts +0 -1
- package/dist/inner-plugins/constants.js +3 -47
- package/dist/{build-utils/common/trans-utils/index.js → inner-plugins/index.cjs} +14 -5
- package/dist/inner-plugins/index.d.ts +0 -1
- package/dist/inner-plugins/index.js +4 -69
- package/dist/inner-plugins/loaders/proxy.cjs +90 -0
- package/dist/inner-plugins/loaders/proxy.d.ts +4 -2
- package/dist/inner-plugins/loaders/proxy.js +19 -22
- package/dist/inner-plugins/plugins/base.cjs +53 -0
- package/dist/inner-plugins/plugins/base.d.ts +3 -5
- package/dist/inner-plugins/plugins/base.js +6 -38
- package/dist/inner-plugins/plugins/bundle.cjs +121 -0
- package/dist/inner-plugins/plugins/bundle.d.ts +1 -1
- package/dist/inner-plugins/plugins/bundle.js +33 -49
- package/dist/inner-plugins/plugins/bundleTagPlugin.cjs +93 -0
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts +0 -1
- package/dist/inner-plugins/plugins/bundleTagPlugin.js +12 -44
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.cjs +166 -0
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts +0 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.js +42 -70
- package/dist/inner-plugins/plugins/errors.cjs +98 -0
- package/dist/inner-plugins/plugins/errors.d.ts +0 -1
- package/dist/inner-plugins/plugins/errors.js +20 -52
- package/dist/inner-plugins/plugins/index.cjs +141 -0
- package/dist/inner-plugins/plugins/index.d.ts +0 -1
- package/dist/inner-plugins/plugins/index.js +12 -141
- package/dist/inner-plugins/plugins/loader.cjs +155 -0
- package/dist/inner-plugins/plugins/loader.d.ts +0 -1
- package/dist/inner-plugins/plugins/loader.js +29 -57
- package/dist/inner-plugins/plugins/plugins.cjs +73 -0
- package/dist/inner-plugins/plugins/plugins.d.ts +0 -1
- package/dist/inner-plugins/plugins/plugins.js +18 -50
- package/dist/inner-plugins/plugins/progress.cjs +70 -0
- package/dist/inner-plugins/plugins/progress.d.ts +0 -1
- package/dist/inner-plugins/plugins/progress.js +9 -41
- package/dist/inner-plugins/plugins/rspack.cjs +117 -0
- package/dist/inner-plugins/plugins/rspack.d.ts +0 -1
- package/dist/inner-plugins/plugins/rspack.js +24 -56
- package/dist/inner-plugins/plugins/rules.cjs +97 -0
- package/dist/inner-plugins/plugins/rules.d.ts +0 -1
- package/dist/inner-plugins/plugins/rules.js +19 -51
- package/dist/inner-plugins/plugins/sourcemapTool.cjs +213 -0
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts +0 -1
- package/dist/inner-plugins/plugins/sourcemapTool.js +23 -67
- package/dist/inner-plugins/plugins/summary.cjs +125 -0
- package/dist/inner-plugins/plugins/summary.d.ts +0 -1
- package/dist/inner-plugins/plugins/summary.js +28 -60
- package/dist/inner-plugins/utils/circleDetect.cjs +49 -0
- package/dist/inner-plugins/utils/circleDetect.d.ts +0 -1
- package/dist/inner-plugins/utils/circleDetect.js +3 -35
- package/dist/inner-plugins/utils/config.cjs +177 -0
- package/dist/inner-plugins/utils/config.d.ts +3 -8
- package/dist/inner-plugins/utils/config.js +43 -116
- package/dist/inner-plugins/utils/index.cjs +124 -0
- package/dist/inner-plugins/utils/index.d.ts +4 -1
- package/dist/inner-plugins/utils/index.js +9 -96
- package/dist/inner-plugins/utils/loader.cjs +231 -0
- package/dist/inner-plugins/utils/loader.d.ts +4 -4
- package/dist/inner-plugins/utils/loader.js +39 -97
- package/dist/inner-plugins/utils/normalize-config.cjs +122 -0
- package/dist/inner-plugins/utils/normalize-config.d.ts +40 -0
- package/dist/inner-plugins/utils/normalize-config.js +78 -0
- package/dist/inner-plugins/utils/plugin-common.cjs +73 -0
- package/dist/inner-plugins/utils/plugin-common.d.ts +6 -0
- package/dist/inner-plugins/utils/plugin-common.js +28 -0
- package/dist/inner-plugins/utils/plugin.cjs +107 -0
- package/dist/inner-plugins/utils/plugin.d.ts +2 -4
- package/dist/inner-plugins/utils/plugin.js +5 -40
- package/dist/inner-plugins/utils/sdk.cjs +55 -0
- package/dist/inner-plugins/utils/sdk.d.ts +8 -4
- package/dist/inner-plugins/utils/sdk.js +9 -42
- package/dist/rules/index.cjs +85 -0
- package/dist/rules/index.d.ts +0 -1
- package/dist/rules/index.js +6 -85
- package/dist/rules/linter.cjs +71 -0
- package/dist/rules/linter.d.ts +0 -1
- package/dist/rules/linter.js +11 -46
- package/dist/rules/rule.cjs +137 -0
- package/dist/rules/rule.d.ts +1 -2
- package/dist/rules/rule.js +20 -55
- package/dist/rules/rules/cross-chunks-package/index.cjs +73 -0
- package/dist/rules/rules/cross-chunks-package/index.d.ts +0 -1
- package/dist/rules/rules/cross-chunks-package/index.js +10 -42
- package/dist/rules/rules/cross-chunks-package/types.d.ts +0 -1
- package/dist/rules/rules/cross-chunks-package/types.js +2 -18
- package/dist/rules/rules/cross-chunks-package/utils.cjs +40 -0
- package/dist/rules/rules/cross-chunks-package/utils.d.ts +1 -2
- package/dist/rules/rules/cross-chunks-package/utils.js +4 -36
- package/dist/rules/rules/default-import-check/index.cjs +116 -0
- package/dist/rules/rules/default-import-check/index.d.ts +0 -1
- package/dist/rules/rules/default-import-check/index.js +17 -49
- package/dist/rules/rules/default-import-check/types.cjs +18 -0
- package/dist/rules/rules/default-import-check/types.d.ts +0 -1
- package/dist/rules/rules/default-import-check/types.js +2 -18
- package/dist/rules/rules/default-import-check/utils.cjs +98 -0
- package/dist/rules/rules/default-import-check/utils.d.ts +0 -1
- package/dist/rules/rules/default-import-check/utils.js +9 -53
- package/dist/rules/rules/duplicate-package/index.cjs +71 -0
- package/dist/rules/rules/duplicate-package/index.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/index.js +15 -47
- package/dist/rules/rules/duplicate-package/types.cjs +60 -0
- package/dist/rules/rules/duplicate-package/types.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/types.js +5 -40
- package/dist/rules/rules/duplicate-package/utils.cjs +84 -0
- package/dist/rules/rules/duplicate-package/utils.d.ts +0 -1
- package/dist/rules/rules/duplicate-package/utils.js +6 -51
- package/dist/rules/rules/ecma-version-check/index.cjs +97 -0
- package/dist/rules/rules/ecma-version-check/index.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/index.js +16 -58
- package/dist/rules/rules/ecma-version-check/types.cjs +18 -0
- package/dist/rules/rules/ecma-version-check/types.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/types.js +2 -18
- package/dist/rules/rules/ecma-version-check/utils.cjs +39 -0
- package/dist/rules/rules/ecma-version-check/utils.d.ts +0 -1
- package/dist/rules/rules/ecma-version-check/utils.js +3 -35
- package/dist/rules/rules/index.cjs +47 -0
- package/dist/rules/rules/index.d.ts +0 -1
- package/dist/rules/rules/index.js +13 -45
- package/dist/rules/rules/loader-performance-optimization/index.cjs +119 -0
- package/dist/rules/rules/loader-performance-optimization/index.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/index.js +14 -46
- package/dist/rules/rules/loader-performance-optimization/types.cjs +18 -0
- package/dist/rules/rules/loader-performance-optimization/types.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/types.js +2 -18
- package/dist/{build-utils/common/chunks/assetsContent.js → rules/rules/loader-performance-optimization/utils.cjs} +9 -10
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.js +3 -35
- package/dist/rules/utils.cjs +46 -0
- package/dist/rules/utils.d.ts +0 -1
- package/dist/rules/utils.js +6 -41
- package/dist/types/chunks.cjs +18 -0
- package/dist/types/chunks.d.ts +1 -7
- package/dist/types/chunks.js +2 -18
- package/dist/types/index.cjs +87 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +6 -96
- package/dist/types/loader.cjs +18 -0
- package/dist/types/loader.d.ts +0 -1
- package/dist/types/loader.js +2 -18
- package/dist/types/plugin.cjs +18 -0
- package/dist/types/plugin.d.ts +7 -108
- package/dist/types/plugin.js +2 -18
- package/dist/types/rules.cjs +18 -0
- package/dist/types/rules.d.ts +0 -1
- package/dist/types/rules.js +2 -18
- package/package.json +33 -34
- package/dist/build-utils/build/chunks/assetsModules.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/chunkTransform.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/index.d.ts.map +0 -1
- package/dist/build-utils/build/chunks/rspack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/index.d.ts.map +0 -1
- package/dist/build-utils/build/loader/index.d.ts.map +0 -1
- package/dist/build-utils/build/loader/probeLoader.d.ts.map +0 -1
- package/dist/build-utils/build/loader/probeLoaderPlugin.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/index.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/parser.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/rspack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/transform.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/treeShaking.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/utils.d.ts.map +0 -1
- package/dist/build-utils/build/module-graph/webpack/transform.d.ts.map +0 -1
- package/dist/build-utils/build/utils/index.d.ts.map +0 -1
- package/dist/build-utils/build/utils/loader.d.ts.map +0 -1
- package/dist/build-utils/build/utils/parseBundle.d.ts.map +0 -1
- package/dist/build-utils/build/utils/plugin.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsContent.d.ts +0 -6
- package/dist/build-utils/common/chunks/assetsContent.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsModules.d.ts +0 -23
- package/dist/build-utils/common/chunks/assetsModules.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/assetsModules.js +0 -155
- package/dist/build-utils/common/chunks/chunkTransform.d.ts +0 -6
- package/dist/build-utils/common/chunks/chunkTransform.d.ts.map +0 -1
- package/dist/build-utils/common/chunks/chunkTransform.js +0 -74
- package/dist/build-utils/common/chunks/index.d.ts +0 -4
- package/dist/build-utils/common/chunks/index.d.ts.map +0 -1
- package/dist/build-utils/common/index.d.ts +0 -6
- package/dist/build-utils/common/index.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/compatible.d.ts +0 -9
- package/dist/build-utils/common/module-graph/compatible.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/compatible.js +0 -73
- package/dist/build-utils/common/module-graph/index.d.ts +0 -4
- package/dist/build-utils/common/module-graph/index.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/transform.d.ts +0 -8
- package/dist/build-utils/common/module-graph/transform.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/transform.js +0 -181
- package/dist/build-utils/common/module-graph/utils.d.ts +0 -14
- package/dist/build-utils/common/module-graph/utils.d.ts.map +0 -1
- package/dist/build-utils/common/module-graph/utils.js +0 -58
- package/dist/build-utils/common/trans-utils/index.d.ts +0 -2
- package/dist/build-utils/common/trans-utils/index.d.ts.map +0 -1
- package/dist/build-utils/common/trans-utils/transStats.d.ts +0 -11
- package/dist/build-utils/common/trans-utils/transStats.d.ts.map +0 -1
- package/dist/build-utils/common/webpack/compatible.d.ts +0 -18
- package/dist/build-utils/common/webpack/compatible.d.ts.map +0 -1
- package/dist/build-utils/common/webpack/compatible.js +0 -156
- package/dist/build-utils/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/inner-plugins/constants.d.ts.map +0 -1
- package/dist/inner-plugins/index.d.ts.map +0 -1
- package/dist/inner-plugins/loaders/proxy.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/base.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/bundle.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/bundleTagPlugin.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/ensureModulesChunkGraph.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/errors.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/index.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/loader.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/plugins.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/progress.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/rspack.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/rules.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/sourcemapTool.d.ts.map +0 -1
- package/dist/inner-plugins/plugins/summary.d.ts.map +0 -1
- package/dist/inner-plugins/utils/circleDetect.d.ts.map +0 -1
- package/dist/inner-plugins/utils/config.d.ts.map +0 -1
- package/dist/inner-plugins/utils/index.d.ts.map +0 -1
- package/dist/inner-plugins/utils/loader.d.ts.map +0 -1
- package/dist/inner-plugins/utils/plugin.d.ts.map +0 -1
- package/dist/inner-plugins/utils/sdk.d.ts.map +0 -1
- package/dist/rules/index.d.ts.map +0 -1
- package/dist/rules/linter.d.ts.map +0 -1
- package/dist/rules/rule.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/index.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/types.d.ts.map +0 -1
- package/dist/rules/rules/cross-chunks-package/utils.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/index.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/types.d.ts.map +0 -1
- package/dist/rules/rules/default-import-check/utils.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/index.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/types.d.ts.map +0 -1
- package/dist/rules/rules/duplicate-package/utils.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/index.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/types.d.ts.map +0 -1
- package/dist/rules/rules/ecma-version-check/utils.d.ts.map +0 -1
- package/dist/rules/rules/index.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/index.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/types.d.ts.map +0 -1
- package/dist/rules/rules/loader-performance-optimization/utils.d.ts.map +0 -1
- package/dist/rules/utils.d.ts.map +0 -1
- package/dist/types/chunks.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/loader.d.ts.map +0 -1
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/rules.d.ts.map +0 -1
- package/dist/types/webpack.d.ts +0 -15
- package/dist/types/webpack.d.ts.map +0 -1
- /package/dist/{types/webpack.js → rules/rules/cross-chunks-package/types.cjs} +0 -0
|
@@ -1,72 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
interceptLoader: ()=>interceptLoader,
|
|
37
|
-
reportLoader: ()=>reportLoader,
|
|
38
|
-
shouldSkipLoader: ()=>shouldSkipLoader,
|
|
39
|
-
getOriginLoaderModule: ()=>getOriginLoaderModule,
|
|
40
|
-
getInternalLoaderOptions: ()=>getInternalLoaderOptions,
|
|
41
|
-
getLoaderOptionsWithoutInternalKeys: ()=>getLoaderOptionsWithoutInternalKeys
|
|
42
|
-
});
|
|
43
|
-
const external_axios_namespaceObject = require("axios");
|
|
44
|
-
var external_axios_default = /*#__PURE__*/ __webpack_require__.n(external_axios_namespaceObject);
|
|
45
|
-
const external_enhanced_resolve_namespaceObject = require("enhanced-resolve");
|
|
46
|
-
const external_fs_namespaceObject = require("fs");
|
|
47
|
-
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
48
|
-
const external_lodash_namespaceObject = require("lodash");
|
|
49
|
-
const external_path_namespaceObject = require("path");
|
|
50
|
-
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
51
|
-
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
52
|
-
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
53
|
-
const types_namespaceObject = require("@rsdoctor/types");
|
|
54
|
-
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
55
|
-
const external_sdk_js_namespaceObject = require("./sdk.js");
|
|
56
|
-
const external_circleDetect_js_namespaceObject = require("./circleDetect.js");
|
|
57
|
-
const index_js_namespaceObject = require("../../build-utils/build/index.js");
|
|
58
|
-
const utils_index_js_namespaceObject = require("../../build-utils/build/utils/index.js");
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
import enhanced_resolve from "enhanced-resolve";
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import { omit } from "lodash-es";
|
|
7
|
+
import path from "path";
|
|
8
|
+
import { logger } from "@rsdoctor/utils/logger";
|
|
9
|
+
import { Loader, Lodash, Time } from "@rsdoctor/utils/common";
|
|
10
|
+
import { SDK } from "@rsdoctor/types";
|
|
11
|
+
import { DevToolError } from "@rsdoctor/utils/error";
|
|
12
|
+
import { getSDK } from "./sdk.js";
|
|
13
|
+
import { checkCirclePath } from "./circleDetect.js";
|
|
14
|
+
import { Utils } from "../../build-utils/build/index.js";
|
|
15
|
+
import { isESMLoader, parseQuery } from "../../build-utils/build/utils/index.js";
|
|
16
|
+
const { CachedInputFileSystem, create: ResolverCreator } = enhanced_resolve;
|
|
59
17
|
function getInternalLoaderOptions(loaderContext) {
|
|
60
18
|
const options = loaderContext.getOptions();
|
|
61
|
-
return options[
|
|
19
|
+
return options[Loader.LoaderInternalPropertyName];
|
|
62
20
|
}
|
|
63
21
|
function getLoaderOptionsWithoutInternalKeys(loaderContext) {
|
|
64
22
|
const options = loaderContext.getOptions();
|
|
65
23
|
const circlePaths = [];
|
|
66
|
-
const loaderOptions =
|
|
67
|
-
|
|
24
|
+
const loaderOptions = omit(options, [
|
|
25
|
+
Loader.LoaderInternalPropertyName
|
|
68
26
|
]);
|
|
69
|
-
|
|
27
|
+
checkCirclePath(loaderOptions, [], circlePaths, 0);
|
|
70
28
|
if (circlePaths.length > 0) circlePaths.forEach((_path)=>{
|
|
71
29
|
if ((null == _path ? void 0 : _path.length) > 0 && '[Circular]' !== loaderOptions[_path[0]]) loaderOptions[_path[0]] = '[Circular]';
|
|
72
30
|
});
|
|
@@ -74,21 +32,21 @@ function getLoaderOptionsWithoutInternalKeys(loaderContext) {
|
|
|
74
32
|
}
|
|
75
33
|
function getOriginLoaderModule(loaderContext) {
|
|
76
34
|
const { loader, cwd } = getInternalLoaderOptions(loaderContext);
|
|
77
|
-
return
|
|
35
|
+
return Utils.loadLoaderModule(loader, cwd);
|
|
78
36
|
}
|
|
79
37
|
function shouldSkipLoader(loaderContext) {
|
|
80
38
|
const { skipLoaders, cwd, loader } = getInternalLoaderOptions(loaderContext) || {};
|
|
81
39
|
if (!loader) return true;
|
|
82
40
|
if (Array.isArray(skipLoaders) && skipLoaders.length) {
|
|
83
41
|
if (skipLoaders.includes(loader)) return true;
|
|
84
|
-
const loaderName =
|
|
42
|
+
const loaderName = Utils.extractLoaderName(loader, cwd);
|
|
85
43
|
if (skipLoaders.includes(loaderName)) return true;
|
|
86
44
|
}
|
|
87
45
|
return false;
|
|
88
46
|
}
|
|
89
47
|
function interceptLoader(rules, loaderPath, options, cwd = process.cwd(), resolveLoader) {
|
|
90
|
-
const loaderResolver =
|
|
91
|
-
fileSystem: new
|
|
48
|
+
const loaderResolver = ResolverCreator.sync({
|
|
49
|
+
fileSystem: new CachedInputFileSystem(fs, 4000),
|
|
92
50
|
conditionNames: [
|
|
93
51
|
'loader',
|
|
94
52
|
'require',
|
|
@@ -120,13 +78,13 @@ function interceptLoader(rules, loaderPath, options, cwd = process.cwd(), resolv
|
|
|
120
78
|
} catch (e) {}
|
|
121
79
|
return target;
|
|
122
80
|
};
|
|
123
|
-
return
|
|
81
|
+
return Utils.mapEachRules(rules, (rule)=>{
|
|
124
82
|
var _rule_loader, _rule_loader1;
|
|
125
|
-
if ((null == (_rule_loader = rule.loader) ? void 0 : _rule_loader.startsWith('builtin:')) || (null == (_rule_loader1 = rule.loader) ? void 0 : _rule_loader1.endsWith('.mjs')) ||
|
|
83
|
+
if ((null == (_rule_loader = rule.loader) ? void 0 : _rule_loader.startsWith('builtin:')) || (null == (_rule_loader1 = rule.loader) ? void 0 : _rule_loader1.endsWith('.mjs')) || isESMLoader(rule)) return rule;
|
|
126
84
|
const opts = {
|
|
127
85
|
...'options' in rule ? 'string' == typeof rule.options ? JSON.parse(rule.options) : rule.options : {}
|
|
128
86
|
};
|
|
129
|
-
opts[
|
|
87
|
+
opts[Loader.LoaderInternalPropertyName] = rule.loader && /proxy\.(js|cjs)/.test(rule.loader) && 'options' in rule && 'object' == typeof rule.options ? rule.options[Loader.LoaderInternalPropertyName] : {
|
|
130
88
|
...options,
|
|
131
89
|
hasOptions: 'options' in rule && Boolean(rule.options),
|
|
132
90
|
loader: 'loader' in rule ? resolve(rule.loader) : ''
|
|
@@ -140,22 +98,22 @@ function interceptLoader(rules, loaderPath, options, cwd = process.cwd(), resolv
|
|
|
140
98
|
}
|
|
141
99
|
async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, res, sourceMap) {
|
|
142
100
|
var _ctx__module, _ctx__module1, _ctx__compilation;
|
|
143
|
-
const end =
|
|
101
|
+
const end = Time.getCurrentTimestamp(start, startHRTime);
|
|
144
102
|
const { loader, host } = getInternalLoaderOptions(ctx);
|
|
145
103
|
const loaderData = [
|
|
146
104
|
{
|
|
147
105
|
resource: {
|
|
148
106
|
path: (null == (_ctx__module = ctx._module) ? void 0 : _ctx__module.layer) ? `${ctx.resourcePath}[${ctx._module.layer}]` : ctx.resourcePath,
|
|
149
|
-
query:
|
|
107
|
+
query: parseQuery(ctx.resourceQuery || '?'),
|
|
150
108
|
queryRaw: ctx.resourceQuery,
|
|
151
|
-
ext:
|
|
109
|
+
ext: path.extname(ctx.resourcePath).slice(1),
|
|
152
110
|
...(null == (_ctx__module1 = ctx._module) ? void 0 : _ctx__module1.layer) ? {
|
|
153
111
|
layer: ctx._module.layer
|
|
154
112
|
} : {}
|
|
155
113
|
},
|
|
156
114
|
loaders: [
|
|
157
115
|
{
|
|
158
|
-
loader:
|
|
116
|
+
loader: Utils.extractLoaderName(loader),
|
|
159
117
|
loaderIndex: ctx.loaderIndex,
|
|
160
118
|
path: loader,
|
|
161
119
|
input: code,
|
|
@@ -166,7 +124,7 @@ async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, r
|
|
|
166
124
|
isPitch,
|
|
167
125
|
sync,
|
|
168
126
|
errors: err ? [
|
|
169
|
-
new
|
|
127
|
+
new DevToolError(code, err.message, {
|
|
170
128
|
controller: {
|
|
171
129
|
noStack: false,
|
|
172
130
|
noColor: true
|
|
@@ -180,7 +138,7 @@ async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, r
|
|
|
180
138
|
]
|
|
181
139
|
}
|
|
182
140
|
];
|
|
183
|
-
const data = sourceMap ?
|
|
141
|
+
const data = sourceMap ? Lodash.isString(sourceMap) ? JSON.parse(sourceMap) : sourceMap : {};
|
|
184
142
|
const sourceMapData = {
|
|
185
143
|
version: data.version ?? -1,
|
|
186
144
|
sources: data.sources ?? [],
|
|
@@ -190,40 +148,24 @@ async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, r
|
|
|
190
148
|
mappings: data.mappings,
|
|
191
149
|
file: loaderData[0].resource.path
|
|
192
150
|
};
|
|
193
|
-
const sdk =
|
|
151
|
+
const sdk = getSDK(null == (_ctx__compilation = ctx._compilation) ? void 0 : _ctx__compilation.name);
|
|
194
152
|
if ((null == sdk ? void 0 : sdk.reportLoader) && !('parent' in sdk && sdk.parent)) {
|
|
195
153
|
sdk.reportLoader(loaderData);
|
|
196
154
|
sdk.reportSourceMap(sourceMapData);
|
|
197
155
|
return loaderData;
|
|
198
156
|
}
|
|
199
157
|
await Promise.all([
|
|
200
|
-
|
|
158
|
+
axios.post(`${host}${SDK.ServerAPI.API.ReportLoader}`, loaderData, {
|
|
201
159
|
timeout: 8888
|
|
202
160
|
}).catch((err)=>{
|
|
203
|
-
|
|
161
|
+
logger.debug(`${err.message}`, '[WebpackPlugin.ReportLoader][error]');
|
|
204
162
|
}),
|
|
205
|
-
|
|
163
|
+
axios.post(`${host}${SDK.ServerAPI.API.ReportSourceMap}`, sourceMapData, {
|
|
206
164
|
timeout: 8888
|
|
207
165
|
}).catch((err)=>{
|
|
208
|
-
|
|
166
|
+
logger.debug(`${err.message}`, '[WebpackPlugin.ReportSourceMap][error]');
|
|
209
167
|
})
|
|
210
168
|
]);
|
|
211
169
|
return loaderData;
|
|
212
170
|
}
|
|
213
|
-
|
|
214
|
-
exports.getLoaderOptionsWithoutInternalKeys = __webpack_exports__.getLoaderOptionsWithoutInternalKeys;
|
|
215
|
-
exports.getOriginLoaderModule = __webpack_exports__.getOriginLoaderModule;
|
|
216
|
-
exports.interceptLoader = __webpack_exports__.interceptLoader;
|
|
217
|
-
exports.reportLoader = __webpack_exports__.reportLoader;
|
|
218
|
-
exports.shouldSkipLoader = __webpack_exports__.shouldSkipLoader;
|
|
219
|
-
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
220
|
-
"getInternalLoaderOptions",
|
|
221
|
-
"getLoaderOptionsWithoutInternalKeys",
|
|
222
|
-
"getOriginLoaderModule",
|
|
223
|
-
"interceptLoader",
|
|
224
|
-
"reportLoader",
|
|
225
|
-
"shouldSkipLoader"
|
|
226
|
-
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
227
|
-
Object.defineProperty(exports, '__esModule', {
|
|
228
|
-
value: true
|
|
229
|
-
});
|
|
171
|
+
export { getInternalLoaderOptions, getLoaderOptionsWithoutInternalKeys, getOriginLoaderModule, interceptLoader, reportLoader, shouldSkipLoader };
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
convertReportCodeTypeObject: ()=>convertReportCodeTypeObject,
|
|
28
|
+
makeRuleSetSerializable: ()=>makeRuleSetSerializable,
|
|
29
|
+
makeRulesSerializable: ()=>makeRulesSerializable,
|
|
30
|
+
processBriefHtmlModeConfig: ()=>processBriefHtmlModeConfig,
|
|
31
|
+
processModeConfigurations: ()=>processModeConfigurations
|
|
32
|
+
});
|
|
33
|
+
function processModeConfigurations(finalMode, output, brief) {
|
|
34
|
+
let finalBrief = {};
|
|
35
|
+
let finalNormalOptions = {};
|
|
36
|
+
if ('brief' === finalMode) finalBrief = processBriefHtmlModeConfig(output, brief);
|
|
37
|
+
else if ('normal' === finalMode) finalNormalOptions = {};
|
|
38
|
+
return {
|
|
39
|
+
finalBrief,
|
|
40
|
+
finalNormalOptions
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function processBriefHtmlModeConfig(output, brief) {
|
|
44
|
+
var _briefOptions_type, _briefOptions_type1, _output_options;
|
|
45
|
+
let htmlOptions = {
|
|
46
|
+
reportHtmlName: void 0,
|
|
47
|
+
writeDataJson: false
|
|
48
|
+
};
|
|
49
|
+
let jsonOptions = {};
|
|
50
|
+
const briefOptions = (null == output ? void 0 : output.options) || {};
|
|
51
|
+
if ('type' in briefOptions && (null == (_briefOptions_type = briefOptions.type) ? void 0 : _briefOptions_type.includes('json'))) jsonOptions = briefOptions.jsonOptions || {
|
|
52
|
+
sections: {
|
|
53
|
+
moduleGraph: true,
|
|
54
|
+
chunkGraph: true,
|
|
55
|
+
rules: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
if ('type' in briefOptions && (null == (_briefOptions_type1 = briefOptions.type) ? void 0 : _briefOptions_type1.includes('html')) || !briefOptions.type) {
|
|
59
|
+
const outputBriefOptions = null == briefOptions ? void 0 : briefOptions.htmlOptions;
|
|
60
|
+
const outputBrief = brief;
|
|
61
|
+
htmlOptions = {
|
|
62
|
+
reportHtmlName: (null == outputBriefOptions ? void 0 : outputBriefOptions.reportHtmlName) || (null == outputBrief ? void 0 : outputBrief.reportHtmlName) || void 0,
|
|
63
|
+
writeDataJson: (null == outputBriefOptions ? void 0 : outputBriefOptions.writeDataJson) || (null == outputBrief ? void 0 : outputBrief.writeDataJson) || false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
type: (null == (_output_options = output.options) ? void 0 : _output_options.type) || [
|
|
68
|
+
'html'
|
|
69
|
+
],
|
|
70
|
+
htmlOptions,
|
|
71
|
+
jsonOptions
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function convertReportCodeTypeObject(reportCodeType) {
|
|
75
|
+
if (!reportCodeType) return;
|
|
76
|
+
if (reportCodeType.noCode) return 'noCode';
|
|
77
|
+
if (reportCodeType.noAssetsAndModuleSource) return 'noAssetsAndModuleSource';
|
|
78
|
+
if (reportCodeType.noModuleSource) return 'noModuleSource';
|
|
79
|
+
}
|
|
80
|
+
function makeRuleSetSerializable(item) {
|
|
81
|
+
if (!item) return;
|
|
82
|
+
if (item instanceof RegExp) item.toJSON = item.toString;
|
|
83
|
+
else if (Array.isArray(item)) item.forEach((i)=>makeRuleSetSerializable(i));
|
|
84
|
+
else if ('object' == typeof item) {
|
|
85
|
+
makeRuleSetSerializable(item.and);
|
|
86
|
+
makeRuleSetSerializable(item.or);
|
|
87
|
+
makeRuleSetSerializable(item.not);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function makeRulesSerializable(rules) {
|
|
91
|
+
if (!Array.isArray(rules)) return;
|
|
92
|
+
if (!rules.length) return;
|
|
93
|
+
rules.forEach((rule)=>{
|
|
94
|
+
if (!rule) return;
|
|
95
|
+
makeRuleSetSerializable(rule.test);
|
|
96
|
+
makeRuleSetSerializable(rule.resourceQuery);
|
|
97
|
+
makeRuleSetSerializable(rule.resource);
|
|
98
|
+
makeRuleSetSerializable(rule.resourceFragment);
|
|
99
|
+
makeRuleSetSerializable(rule.scheme);
|
|
100
|
+
makeRuleSetSerializable(rule.issuer);
|
|
101
|
+
if ('issuerLayer' in rule) makeRuleSetSerializable(rule.issuerLayer);
|
|
102
|
+
makeRuleSetSerializable(rule.include);
|
|
103
|
+
makeRuleSetSerializable(rule.exclude);
|
|
104
|
+
if (rule.oneOf) makeRulesSerializable(rule.oneOf);
|
|
105
|
+
if ('rules' in rule && rule.rules) makeRulesSerializable(rule.rules);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.convertReportCodeTypeObject = __webpack_exports__.convertReportCodeTypeObject;
|
|
109
|
+
exports.makeRuleSetSerializable = __webpack_exports__.makeRuleSetSerializable;
|
|
110
|
+
exports.makeRulesSerializable = __webpack_exports__.makeRulesSerializable;
|
|
111
|
+
exports.processBriefHtmlModeConfig = __webpack_exports__.processBriefHtmlModeConfig;
|
|
112
|
+
exports.processModeConfigurations = __webpack_exports__.processModeConfigurations;
|
|
113
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
114
|
+
"convertReportCodeTypeObject",
|
|
115
|
+
"makeRuleSetSerializable",
|
|
116
|
+
"makeRulesSerializable",
|
|
117
|
+
"processBriefHtmlModeConfig",
|
|
118
|
+
"processModeConfigurations"
|
|
119
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
120
|
+
Object.defineProperty(exports, '__esModule', {
|
|
121
|
+
value: true
|
|
122
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Config, Plugin, SDK } from '@rsdoctor/types';
|
|
2
|
+
import type { RuleSetCondition as RspackRuleSetCondition, RuleSetRule as RspackRuleSetRule } from '@rspack/core';
|
|
3
|
+
import { RuleSetCondition as WebpackRuleSetCondition, RuleSetConditionAbsolute as WebpackRuleSetConditionAbsolute, RuleSetRule as WebpackRuleSetRule } from 'webpack';
|
|
4
|
+
/**
|
|
5
|
+
* Process mode-specific configurations with priority logic
|
|
6
|
+
*/
|
|
7
|
+
export declare function processModeConfigurations(finalMode: keyof typeof SDK.IMode, output: Config.IOutput<'brief' | 'normal'>, brief: Config.BriefConfig | undefined): {
|
|
8
|
+
finalBrief: {};
|
|
9
|
+
finalNormalOptions: Config.NormalModeOptions;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Process brief mode configuration with priority logic
|
|
13
|
+
* Priority: output.options.briefOptions > output.brief > default
|
|
14
|
+
*/
|
|
15
|
+
export declare function processBriefHtmlModeConfig(output: Config.BriefModeConfig, brief: Config.BriefConfig | undefined): Config.BriefModeOptions;
|
|
16
|
+
/**
|
|
17
|
+
* Convert reportCodeType object to NewReportCodeType enum value
|
|
18
|
+
*/
|
|
19
|
+
export declare function convertReportCodeTypeObject(reportCodeType: any): Config.NewReportCodeType | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* This function recursively processes rule set conditions to ensure they can be
|
|
22
|
+
* properly serialized to JSON.
|
|
23
|
+
*
|
|
24
|
+
* @param item - The rule set condition to make serializable. Can be:
|
|
25
|
+
* - RspackRuleSetCondition: Rspack-specific rule conditions
|
|
26
|
+
* - WebpackRuleSetConditionAbsolute: Webpack absolute rule conditions
|
|
27
|
+
* - WebpackRuleSetCondition: Webpack rule conditions
|
|
28
|
+
* - void: Undefined or null values
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const condition = /\.js$/;
|
|
33
|
+
* JSON.stringify(condition); // Error: Converting circular structure to JSON
|
|
34
|
+
*
|
|
35
|
+
* makeRuleSetSerializable(condition);
|
|
36
|
+
* JSON.stringify(condition); // '"/\\.js$/"'
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function makeRuleSetSerializable(item: RspackRuleSetCondition | WebpackRuleSetConditionAbsolute | WebpackRuleSetCondition | void): void;
|
|
40
|
+
export declare function makeRulesSerializable(rules: Plugin.RuleSetRule[] | RspackRuleSetRule['oneOf'] | WebpackRuleSetRule['oneOf']): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
function processModeConfigurations(finalMode, output, brief) {
|
|
4
|
+
let finalBrief = {};
|
|
5
|
+
let finalNormalOptions = {};
|
|
6
|
+
if ('brief' === finalMode) finalBrief = processBriefHtmlModeConfig(output, brief);
|
|
7
|
+
else if ('normal' === finalMode) finalNormalOptions = {};
|
|
8
|
+
return {
|
|
9
|
+
finalBrief,
|
|
10
|
+
finalNormalOptions
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function processBriefHtmlModeConfig(output, brief) {
|
|
14
|
+
var _briefOptions_type, _briefOptions_type1, _output_options;
|
|
15
|
+
let htmlOptions = {
|
|
16
|
+
reportHtmlName: void 0,
|
|
17
|
+
writeDataJson: false
|
|
18
|
+
};
|
|
19
|
+
let jsonOptions = {};
|
|
20
|
+
const briefOptions = (null == output ? void 0 : output.options) || {};
|
|
21
|
+
if ('type' in briefOptions && (null == (_briefOptions_type = briefOptions.type) ? void 0 : _briefOptions_type.includes('json'))) jsonOptions = briefOptions.jsonOptions || {
|
|
22
|
+
sections: {
|
|
23
|
+
moduleGraph: true,
|
|
24
|
+
chunkGraph: true,
|
|
25
|
+
rules: true
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
if ('type' in briefOptions && (null == (_briefOptions_type1 = briefOptions.type) ? void 0 : _briefOptions_type1.includes('html')) || !briefOptions.type) {
|
|
29
|
+
const outputBriefOptions = null == briefOptions ? void 0 : briefOptions.htmlOptions;
|
|
30
|
+
const outputBrief = brief;
|
|
31
|
+
htmlOptions = {
|
|
32
|
+
reportHtmlName: (null == outputBriefOptions ? void 0 : outputBriefOptions.reportHtmlName) || (null == outputBrief ? void 0 : outputBrief.reportHtmlName) || void 0,
|
|
33
|
+
writeDataJson: (null == outputBriefOptions ? void 0 : outputBriefOptions.writeDataJson) || (null == outputBrief ? void 0 : outputBrief.writeDataJson) || false
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
type: (null == (_output_options = output.options) ? void 0 : _output_options.type) || [
|
|
38
|
+
'html'
|
|
39
|
+
],
|
|
40
|
+
htmlOptions,
|
|
41
|
+
jsonOptions
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function convertReportCodeTypeObject(reportCodeType) {
|
|
45
|
+
if (!reportCodeType) return;
|
|
46
|
+
if (reportCodeType.noCode) return 'noCode';
|
|
47
|
+
if (reportCodeType.noAssetsAndModuleSource) return 'noAssetsAndModuleSource';
|
|
48
|
+
if (reportCodeType.noModuleSource) return 'noModuleSource';
|
|
49
|
+
}
|
|
50
|
+
function makeRuleSetSerializable(item) {
|
|
51
|
+
if (!item) return;
|
|
52
|
+
if (item instanceof RegExp) item.toJSON = item.toString;
|
|
53
|
+
else if (Array.isArray(item)) item.forEach((i)=>makeRuleSetSerializable(i));
|
|
54
|
+
else if ('object' == typeof item) {
|
|
55
|
+
makeRuleSetSerializable(item.and);
|
|
56
|
+
makeRuleSetSerializable(item.or);
|
|
57
|
+
makeRuleSetSerializable(item.not);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function makeRulesSerializable(rules) {
|
|
61
|
+
if (!Array.isArray(rules)) return;
|
|
62
|
+
if (!rules.length) return;
|
|
63
|
+
rules.forEach((rule)=>{
|
|
64
|
+
if (!rule) return;
|
|
65
|
+
makeRuleSetSerializable(rule.test);
|
|
66
|
+
makeRuleSetSerializable(rule.resourceQuery);
|
|
67
|
+
makeRuleSetSerializable(rule.resource);
|
|
68
|
+
makeRuleSetSerializable(rule.resourceFragment);
|
|
69
|
+
makeRuleSetSerializable(rule.scheme);
|
|
70
|
+
makeRuleSetSerializable(rule.issuer);
|
|
71
|
+
if ('issuerLayer' in rule) makeRuleSetSerializable(rule.issuerLayer);
|
|
72
|
+
makeRuleSetSerializable(rule.include);
|
|
73
|
+
makeRuleSetSerializable(rule.exclude);
|
|
74
|
+
if (rule.oneOf) makeRulesSerializable(rule.oneOf);
|
|
75
|
+
if ('rules' in rule && rule.rules) makeRulesSerializable(rule.rules);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export { convertReportCodeTypeObject, makeRuleSetSerializable, makeRulesSerializable, processBriefHtmlModeConfig, processModeConfigurations };
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
processCompilerConfig: ()=>processCompilerConfig,
|
|
37
|
+
handleBriefModeReport: ()=>handleBriefModeReport
|
|
38
|
+
});
|
|
39
|
+
const sdk_namespaceObject = require("@rsdoctor/sdk");
|
|
40
|
+
const plugins_namespaceObject = require("@rsdoctor/core/plugins");
|
|
41
|
+
const types_namespaceObject = require("@rsdoctor/types");
|
|
42
|
+
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
43
|
+
const external_lodash_es_namespaceObject = require("lodash-es");
|
|
44
|
+
const external_path_namespaceObject = require("path");
|
|
45
|
+
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
46
|
+
function processCompilerConfig(config) {
|
|
47
|
+
var _rest_module, _rest_module1;
|
|
48
|
+
const { plugins, infrastructureLogging, ...rest } = config;
|
|
49
|
+
const _rest = (0, external_lodash_es_namespaceObject.cloneDeep)(rest);
|
|
50
|
+
if (null == (_rest_module = _rest.module) ? void 0 : _rest_module.defaultRules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.defaultRules);
|
|
51
|
+
if (null == (_rest_module1 = _rest.module) ? void 0 : _rest_module1.rules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.rules);
|
|
52
|
+
return {
|
|
53
|
+
..._rest,
|
|
54
|
+
plugins: plugins.map((e)=>null == e ? void 0 : e.constructor.name)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function handleBriefModeReport(sdk, options, disableClientServer) {
|
|
58
|
+
if (!disableClientServer && options.output.mode === types_namespaceObject.SDK.IMode[types_namespaceObject.SDK.IMode.brief]) {
|
|
59
|
+
const htmlOptions = 'htmlOptions' in options.output.options && options.output.options.htmlOptions || void 0;
|
|
60
|
+
const outputFilePath = external_path_default().resolve(sdk.outputDir, (null == htmlOptions ? void 0 : htmlOptions.reportHtmlName) || 'rsdoctor-report.html');
|
|
61
|
+
console.log(`${logger_namespaceObject.chalk.green('[RSDOCTOR] generated brief report')}: ${outputFilePath}`);
|
|
62
|
+
(0, sdk_namespaceObject.openBrowser)(`file:///${outputFilePath}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.handleBriefModeReport = __webpack_exports__.handleBriefModeReport;
|
|
66
|
+
exports.processCompilerConfig = __webpack_exports__.processCompilerConfig;
|
|
67
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
68
|
+
"handleBriefModeReport",
|
|
69
|
+
"processCompilerConfig"
|
|
70
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
71
|
+
Object.defineProperty(exports, '__esModule', {
|
|
72
|
+
value: true
|
|
73
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Configuration } from '@rspack/core';
|
|
2
|
+
/**
|
|
3
|
+
* Process compiler configuration to make it serializable
|
|
4
|
+
*/
|
|
5
|
+
export declare function processCompilerConfig(config: any): Configuration;
|
|
6
|
+
export declare function handleBriefModeReport(sdk: any, options: any, disableClientServer: boolean): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import { openBrowser } from "@rsdoctor/sdk";
|
|
4
|
+
import { makeRulesSerializable } from "@rsdoctor/core/plugins";
|
|
5
|
+
import { SDK } from "@rsdoctor/types";
|
|
6
|
+
import { chalk } from "@rsdoctor/utils/logger";
|
|
7
|
+
import { cloneDeep } from "lodash-es";
|
|
8
|
+
import path from "path";
|
|
9
|
+
function processCompilerConfig(config) {
|
|
10
|
+
var _rest_module, _rest_module1;
|
|
11
|
+
const { plugins, infrastructureLogging, ...rest } = config;
|
|
12
|
+
const _rest = cloneDeep(rest);
|
|
13
|
+
if (null == (_rest_module = _rest.module) ? void 0 : _rest_module.defaultRules) makeRulesSerializable(_rest.module.defaultRules);
|
|
14
|
+
if (null == (_rest_module1 = _rest.module) ? void 0 : _rest_module1.rules) makeRulesSerializable(_rest.module.rules);
|
|
15
|
+
return {
|
|
16
|
+
..._rest,
|
|
17
|
+
plugins: plugins.map((e)=>null == e ? void 0 : e.constructor.name)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function handleBriefModeReport(sdk, options, disableClientServer) {
|
|
21
|
+
if (!disableClientServer && options.output.mode === SDK.IMode[SDK.IMode.brief]) {
|
|
22
|
+
const htmlOptions = 'htmlOptions' in options.output.options && options.output.options.htmlOptions || void 0;
|
|
23
|
+
const outputFilePath = path.resolve(sdk.outputDir, (null == htmlOptions ? void 0 : htmlOptions.reportHtmlName) || 'rsdoctor-report.html');
|
|
24
|
+
console.log(`${chalk.green('[RSDOCTOR] generated brief report')}: ${outputFilePath}`);
|
|
25
|
+
openBrowser(`file:///${outputFilePath}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export { handleBriefModeReport, processCompilerConfig };
|