@rsdoctor/core 1.3.2 → 1.3.3
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/README.md +1 -1
- package/dist/build-utils/build/loader/probeLoader.cjs +3 -2
- package/dist/build-utils/build/loader/probeLoader.js +1 -1
- package/dist/build-utils/build/module-graph/utils.cjs +12 -2
- package/dist/build-utils/build/module-graph/utils.js +1 -1
- package/dist/build-utils/build/module-graph/webpack/transform.cjs +3 -2
- package/dist/build-utils/build/module-graph/webpack/transform.js +1 -1
- package/dist/build-utils/build/utils/loader.cjs +4 -3
- package/dist/build-utils/build/utils/loader.js +1 -1
- package/dist/build-utils/build/utils/parseBundle.cjs +6 -3
- package/dist/build-utils/build/utils/parseBundle.js +2 -1
- package/dist/inner-plugins/plugins/loader.cjs +10 -5
- package/dist/inner-plugins/plugins/loader.js +3 -1
- package/dist/inner-plugins/plugins/rules.cjs +13 -3
- package/dist/inner-plugins/plugins/rules.js +1 -1
- package/dist/inner-plugins/plugins/summary.cjs +15 -3
- package/dist/inner-plugins/plugins/summary.js +2 -1
- package/dist/inner-plugins/utils/loader.cjs +3 -2
- package/dist/inner-plugins/utils/loader.js +1 -1
- package/dist/inner-plugins/utils/plugin-common.cjs +3 -2
- package/dist/inner-plugins/utils/plugin-common.js +1 -1
- package/dist/rules/rules/cross-chunks-package/index.cjs +12 -2
- package/dist/rules/rules/cross-chunks-package/index.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -38,7 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
38
|
});
|
|
39
39
|
const external_index_cjs_namespaceObject = require("../../index.cjs");
|
|
40
40
|
const index_cjs_namespaceObject = require("../../../inner-plugins/index.cjs");
|
|
41
|
-
const
|
|
41
|
+
const omit_js_namespaceObject = require("lodash/omit.js");
|
|
42
|
+
var omit_js_default = /*#__PURE__*/ __webpack_require__.n(omit_js_namespaceObject);
|
|
42
43
|
const external_path_namespaceObject = require("path");
|
|
43
44
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
44
45
|
const loaderModule = function(...args) {
|
|
@@ -66,7 +67,7 @@ const loaderModule = function(...args) {
|
|
|
66
67
|
result: 'end' === _options.type ? code : null,
|
|
67
68
|
startAt: 'start' === _options.type ? time : 0,
|
|
68
69
|
endAt: 'end' === _options.type ? time : 0,
|
|
69
|
-
options: (
|
|
70
|
+
options: omit_js_default()(_options.options, 'type'),
|
|
70
71
|
isPitch: false,
|
|
71
72
|
sync: false,
|
|
72
73
|
errors: [],
|
|
@@ -2,7 +2,7 @@ import 'module';
|
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { Build } from "../../index.js";
|
|
4
4
|
import { getSDK } from "../../../inner-plugins/index.js";
|
|
5
|
-
import
|
|
5
|
+
import omit from "lodash/omit.js";
|
|
6
6
|
import path from "path";
|
|
7
7
|
const loaderModule = function(...args) {
|
|
8
8
|
var _this__module, _this__module1;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -27,7 +36,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
36
|
getDeclarationIdentifier: ()=>getDeclarationIdentifier,
|
|
28
37
|
getExportIdentifierStatement: ()=>getExportIdentifierStatement
|
|
29
38
|
});
|
|
30
|
-
const
|
|
39
|
+
const isNumber_js_namespaceObject = require("lodash/isNumber.js");
|
|
40
|
+
var isNumber_js_default = /*#__PURE__*/ __webpack_require__.n(isNumber_js_namespaceObject);
|
|
31
41
|
const ruleUtils_namespaceObject = require("@rsdoctor/utils/ruleUtils");
|
|
32
42
|
function getDefaultExportIdentifier(node, module, searchId) {
|
|
33
43
|
var _node_declaration_loc;
|
|
@@ -44,7 +54,7 @@ function getDefaultExportIdentifier(node, module, searchId) {
|
|
|
44
54
|
if (null == (_declaration_id = declaration.id) ? void 0 : _declaration_id.loc) return module.getStatement(declaration.id.loc);
|
|
45
55
|
}
|
|
46
56
|
const startLine = null == (_node_declaration_loc = node.declaration.loc) ? void 0 : _node_declaration_loc.start.line;
|
|
47
|
-
if (!(
|
|
57
|
+
if (!isNumber_js_default()(startLine)) return;
|
|
48
58
|
const { transformed } = module.getSource();
|
|
49
59
|
const endColumn = transformed.split('\n')[startLine - 1].length - 1;
|
|
50
60
|
return module.getStatement({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import
|
|
3
|
+
import isNumber from "lodash/isNumber.js";
|
|
4
4
|
import { parser } from "@rsdoctor/utils/ruleUtils";
|
|
5
5
|
function getDefaultExportIdentifier(node, module, searchId) {
|
|
6
6
|
var _node_declaration_loc;
|
|
@@ -40,7 +40,8 @@ const external_node_fs_namespaceObject = require("node:fs");
|
|
|
40
40
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
41
41
|
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
42
42
|
const external_parser_cjs_namespaceObject = require("../parser.cjs");
|
|
43
|
-
const
|
|
43
|
+
const isFunction_js_namespaceObject = require("lodash/isFunction.js");
|
|
44
|
+
var isFunction_js_default = /*#__PURE__*/ __webpack_require__.n(isFunction_js_namespaceObject);
|
|
44
45
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
45
46
|
async function readFile(target, wbFs) {
|
|
46
47
|
var _wbFs_fs;
|
|
@@ -112,7 +113,7 @@ async function appendModuleData(origin, webpackGraph, graph, wbFs, features, con
|
|
|
112
113
|
module.setProgram(program);
|
|
113
114
|
module.meta.hasSetEsModuleStatement = (0, external_parser_cjs_namespaceObject.hasSetEsModuleStatement)(program);
|
|
114
115
|
}
|
|
115
|
-
const transformed = graph_namespaceObject.Webpack.isExternalModule(origin) ? '' : module.getSource().transformed.length > 0 ? module.getSource().transformed : (
|
|
116
|
+
const transformed = graph_namespaceObject.Webpack.isExternalModule(origin) ? '' : module.getSource().transformed.length > 0 ? module.getSource().transformed : isFunction_js_default()(null == origin ? void 0 : origin.originalSource) ? (null == (_origin_originalSource = origin.originalSource()) ? void 0 : null == (_origin_originalSource_source = _origin_originalSource.source()) ? void 0 : _origin_originalSource_source.toString()) ?? '' : '';
|
|
116
117
|
const transformedSize = graph_namespaceObject.Webpack.isExternalModule(origin) ? 0 : module.getSize().transformedSize > 0 ? module.getSize().transformedSize : Buffer.from(transformed).byteLength;
|
|
117
118
|
module.setSource({
|
|
118
119
|
transformed,
|
|
@@ -3,7 +3,7 @@ import 'module';
|
|
|
3
3
|
import node_fs from "node:fs";
|
|
4
4
|
import { ModuleGraphTrans, Webpack } from "@rsdoctor/graph";
|
|
5
5
|
import { hasSetEsModuleStatement } from "../parser.js";
|
|
6
|
-
import
|
|
6
|
+
import isFunction from "lodash/isFunction.js";
|
|
7
7
|
import { logger } from "@rsdoctor/utils/logger";
|
|
8
8
|
async function readFile(target, wbFs) {
|
|
9
9
|
var _wbFs_fs;
|
|
@@ -66,7 +66,8 @@ var __webpack_exports__ = {};
|
|
|
66
66
|
const external_node_url_namespaceObject = require("node:url");
|
|
67
67
|
const external_fs_extra_namespaceObject = require("fs-extra");
|
|
68
68
|
var external_fs_extra_default = /*#__PURE__*/ __webpack_require__.n(external_fs_extra_namespaceObject);
|
|
69
|
-
const
|
|
69
|
+
const omit_js_namespaceObject = require("lodash/omit.js");
|
|
70
|
+
var omit_js_default = /*#__PURE__*/ __webpack_require__.n(omit_js_namespaceObject);
|
|
70
71
|
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
71
72
|
const graph_namespaceObject = require("@rsdoctor/graph");
|
|
72
73
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
@@ -289,7 +290,7 @@ var __webpack_exports__ = {};
|
|
|
289
290
|
}
|
|
290
291
|
if ('object' == typeof target.query) {
|
|
291
292
|
const options = target.query[common_namespaceObject.Loader.LoaderInternalPropertyName];
|
|
292
|
-
if (options.hasOptions) return (
|
|
293
|
+
if (options.hasOptions) return omit_js_default()(target.query, [
|
|
293
294
|
common_namespaceObject.Loader.LoaderInternalPropertyName
|
|
294
295
|
]);
|
|
295
296
|
const innerLoaderPath = null == options ? void 0 : options.loader;
|
|
@@ -299,7 +300,7 @@ var __webpack_exports__ = {};
|
|
|
299
300
|
}
|
|
300
301
|
return Reflect.get(target, key, receiver);
|
|
301
302
|
case 'getOptions':
|
|
302
|
-
return 'function' == typeof target.getOptions ? ()=>(
|
|
303
|
+
return 'function' == typeof target.getOptions ? ()=>omit_js_default()(target.getOptions(), [
|
|
303
304
|
common_namespaceObject.Loader.LoaderInternalPropertyName
|
|
304
305
|
]) : Reflect.get(target, key, receiver);
|
|
305
306
|
default:
|
|
@@ -4,7 +4,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_module__ from "module";
|
|
|
4
4
|
import node_path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import fs_extra from "fs-extra";
|
|
7
|
-
import
|
|
7
|
+
import omit from "lodash/omit.js";
|
|
8
8
|
import { Loader } from "@rsdoctor/utils/common";
|
|
9
9
|
import { readPackageJson } from "@rsdoctor/graph";
|
|
10
10
|
import { logger } from "@rsdoctor/utils/logger";
|
|
@@ -37,7 +37,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
37
|
});
|
|
38
38
|
const external_fs_namespaceObject = require("fs");
|
|
39
39
|
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
40
|
-
const
|
|
40
|
+
const find_js_namespaceObject = require("lodash/find.js");
|
|
41
|
+
var find_js_default = /*#__PURE__*/ __webpack_require__.n(find_js_namespaceObject);
|
|
42
|
+
const mapValues_js_namespaceObject = require("lodash/mapValues.js");
|
|
43
|
+
var mapValues_js_default = /*#__PURE__*/ __webpack_require__.n(mapValues_js_namespaceObject);
|
|
41
44
|
const external_filesize_namespaceObject = require("filesize");
|
|
42
45
|
const ruleUtils_namespaceObject = require("@rsdoctor/utils/ruleUtils");
|
|
43
46
|
const external_path_namespaceObject = require("path");
|
|
@@ -139,14 +142,14 @@ const parseBundle = (bundlePath, modulesData)=>{
|
|
|
139
142
|
}
|
|
140
143
|
});
|
|
141
144
|
let modules;
|
|
142
|
-
modules = walkState.locations ? (
|
|
145
|
+
modules = walkState.locations ? mapValues_js_default()(walkState.locations, (loc)=>content.slice(loc.start, loc.end)) : {};
|
|
143
146
|
const modulesObj = {};
|
|
144
147
|
for(const module in modules){
|
|
145
148
|
var _find;
|
|
146
149
|
if (!module) return {};
|
|
147
150
|
const moduleContent = modules[module];
|
|
148
151
|
const size = moduleContent && Buffer.byteLength(moduleContent);
|
|
149
|
-
const identifier = (null == (_find = (
|
|
152
|
+
const identifier = (null == (_find = find_js_default()(modulesData, {
|
|
150
153
|
renderId: module
|
|
151
154
|
})) ? void 0 : _find.webpackId) || '';
|
|
152
155
|
modulesObj[identifier] = {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import fs from "fs";
|
|
4
|
-
import
|
|
4
|
+
import find from "lodash/find.js";
|
|
5
|
+
import mapValues from "lodash/mapValues.js";
|
|
5
6
|
import { filesize } from "filesize";
|
|
6
7
|
import { parser } from "@rsdoctor/utils/ruleUtils";
|
|
7
8
|
import { extname } from "path";
|
|
@@ -40,7 +40,12 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
40
40
|
});
|
|
41
41
|
const types_namespaceObject = require("@rsdoctor/types");
|
|
42
42
|
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
43
|
-
const
|
|
43
|
+
const cloneDeep_js_namespaceObject = require("lodash/cloneDeep.js");
|
|
44
|
+
var cloneDeep_js_default = /*#__PURE__*/ __webpack_require__.n(cloneDeep_js_namespaceObject);
|
|
45
|
+
const isEqual_js_namespaceObject = require("lodash/isEqual.js");
|
|
46
|
+
var isEqual_js_default = /*#__PURE__*/ __webpack_require__.n(isEqual_js_namespaceObject);
|
|
47
|
+
const omit_js_namespaceObject = require("lodash/omit.js");
|
|
48
|
+
var omit_js_default = /*#__PURE__*/ __webpack_require__.n(omit_js_namespaceObject);
|
|
44
49
|
const index_cjs_namespaceObject = require("../utils/index.cjs");
|
|
45
50
|
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
46
51
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
@@ -70,11 +75,11 @@ class InternalLoaderPlugin extends external_base_cjs_namespaceObject.InternalBas
|
|
|
70
75
|
if (opts[common_namespaceObject.Loader.LoaderInternalPropertyName]) return {
|
|
71
76
|
...loader,
|
|
72
77
|
loader: opts[common_namespaceObject.Loader.LoaderInternalPropertyName].loader,
|
|
73
|
-
options: (
|
|
78
|
+
options: omit_js_default()(opts, common_namespaceObject.Loader.LoaderInternalPropertyName)
|
|
74
79
|
};
|
|
75
80
|
return loader;
|
|
76
81
|
});
|
|
77
|
-
const newLoaders = (
|
|
82
|
+
const newLoaders = cloneDeep_js_default()(originLoaders);
|
|
78
83
|
if ('object' == typeof compiler.options.cache && 'version' in compiler.options.cache && 'string' == typeof compiler.options.cache.version && compiler.options.cache.version.indexOf('next/dist/build') > -1) callback(loaderContext, module || {});
|
|
79
84
|
else {
|
|
80
85
|
const proxyModule = new Proxy(module || {}, {
|
|
@@ -83,7 +88,7 @@ class InternalLoaderPlugin extends external_base_cjs_namespaceObject.InternalBas
|
|
|
83
88
|
return Reflect.get(target, p, receiver);
|
|
84
89
|
},
|
|
85
90
|
set (target, p, newValue, receiver) {
|
|
86
|
-
const _newValue = (
|
|
91
|
+
const _newValue = cloneDeep_js_default()(newValue);
|
|
87
92
|
if ('loaders' === p) {
|
|
88
93
|
if (Array.isArray(_newValue)) {
|
|
89
94
|
newLoaders.length = 0;
|
|
@@ -100,7 +105,7 @@ class InternalLoaderPlugin extends external_base_cjs_namespaceObject.InternalBas
|
|
|
100
105
|
});
|
|
101
106
|
callback(loaderContext, proxyModule);
|
|
102
107
|
}
|
|
103
|
-
if (!(
|
|
108
|
+
if (!isEqual_js_default()(originLoaders, newLoaders)) {
|
|
104
109
|
const rules = this.getInterceptRules(compiler, newLoaders.map((e)=>({
|
|
105
110
|
loader: e.loader,
|
|
106
111
|
options: e.options
|
|
@@ -2,7 +2,9 @@ import __rslib_shim_module__ from 'module';
|
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
3
3
|
import { Manifest } from "@rsdoctor/types";
|
|
4
4
|
import { Loader } from "@rsdoctor/utils/common";
|
|
5
|
-
import
|
|
5
|
+
import cloneDeep from "lodash/cloneDeep.js";
|
|
6
|
+
import isEqual from "lodash/isEqual.js";
|
|
7
|
+
import omit from "lodash/omit.js";
|
|
6
8
|
import { interceptLoader } from "../utils/index.js";
|
|
7
9
|
import { InternalBasePlugin } from "./base.js";
|
|
8
10
|
import { time, timeEnd } from "@rsdoctor/utils/logger";
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -29,7 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
38
|
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
30
39
|
const index_cjs_namespaceObject = require("../../rules/index.cjs");
|
|
31
40
|
const error_namespaceObject = require("@rsdoctor/utils/error");
|
|
32
|
-
const
|
|
41
|
+
const pull_js_namespaceObject = require("lodash/pull.js");
|
|
42
|
+
var pull_js_default = /*#__PURE__*/ __webpack_require__.n(pull_js_namespaceObject);
|
|
33
43
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
34
44
|
class InternalRulesPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
35
45
|
apply(compiler) {
|
|
@@ -56,8 +66,8 @@ class InternalRulesPlugin extends external_base_cjs_namespaceObject.InternalBase
|
|
|
56
66
|
const warnings = validateErrors.filter((item)=>'Warn' === item.level);
|
|
57
67
|
const toWebpackError = (err)=>err.toError();
|
|
58
68
|
result.replace.forEach((item)=>{
|
|
59
|
-
if (Array.isArray(compilation.errors) && compilation.errors.includes(item)) (
|
|
60
|
-
if (Array.isArray(compilation.warnings) && compilation.warnings.includes(item)) (
|
|
69
|
+
if (Array.isArray(compilation.errors) && compilation.errors.includes(item)) pull_js_default()(compilation.errors, item);
|
|
70
|
+
if (Array.isArray(compilation.warnings) && compilation.warnings.includes(item)) pull_js_default()(compilation.warnings, item);
|
|
61
71
|
});
|
|
62
72
|
if (Array.isArray(compilation.errors)) errors.forEach((err)=>{
|
|
63
73
|
compilation.warnings.push(toWebpackError(err));
|
|
@@ -3,7 +3,7 @@ import 'module';
|
|
|
3
3
|
import { InternalBasePlugin } from "./base.js";
|
|
4
4
|
import { Linter } from "../../rules/index.js";
|
|
5
5
|
import { DevToolError } from "@rsdoctor/utils/error";
|
|
6
|
-
import
|
|
6
|
+
import pull from "lodash/pull.js";
|
|
7
7
|
import { time, timeEnd } from "@rsdoctor/utils/logger";
|
|
8
8
|
class InternalRulesPlugin extends InternalBasePlugin {
|
|
9
9
|
apply(compiler) {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -27,7 +36,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
36
|
InternalSummaryPlugin: ()=>InternalSummaryPlugin
|
|
28
37
|
});
|
|
29
38
|
const common_namespaceObject = require("@rsdoctor/utils/common");
|
|
30
|
-
const
|
|
39
|
+
const minBy_js_namespaceObject = require("lodash/minBy.js");
|
|
40
|
+
var minBy_js_default = /*#__PURE__*/ __webpack_require__.n(minBy_js_namespaceObject);
|
|
41
|
+
const sumBy_js_namespaceObject = require("lodash/sumBy.js");
|
|
42
|
+
var sumBy_js_default = /*#__PURE__*/ __webpack_require__.n(sumBy_js_namespaceObject);
|
|
31
43
|
const external_base_cjs_namespaceObject = require("./base.cjs");
|
|
32
44
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
33
45
|
class InternalSummaryPlugin extends external_base_cjs_namespaceObject.InternalBasePlugin {
|
|
@@ -104,8 +116,8 @@ class InternalSummaryPlugin extends external_base_cjs_namespaceObject.InternalBa
|
|
|
104
116
|
costs: [
|
|
105
117
|
{
|
|
106
118
|
name: common_namespaceObject.Summary.SummaryCostsDataName.Minify,
|
|
107
|
-
startAt: (
|
|
108
|
-
costs: (
|
|
119
|
+
startAt: minBy_js_default()(minifyHookData, (e)=>e.startAt).startAt,
|
|
120
|
+
costs: sumBy_js_default()(minifyHookData, (e)=>e.costs)
|
|
109
121
|
}
|
|
110
122
|
]
|
|
111
123
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { Summary } from "@rsdoctor/utils/common";
|
|
4
|
-
import
|
|
4
|
+
import minBy from "lodash/minBy.js";
|
|
5
|
+
import sumBy from "lodash/sumBy.js";
|
|
5
6
|
import { InternalBasePlugin } from "./base.js";
|
|
6
7
|
import { time, timeEnd } from "@rsdoctor/utils/logger";
|
|
7
8
|
class InternalSummaryPlugin extends InternalBasePlugin {
|
|
@@ -46,7 +46,8 @@ const external_enhanced_resolve_namespaceObject = require("enhanced-resolve");
|
|
|
46
46
|
var external_enhanced_resolve_default = /*#__PURE__*/ __webpack_require__.n(external_enhanced_resolve_namespaceObject);
|
|
47
47
|
const external_fs_namespaceObject = require("fs");
|
|
48
48
|
var external_fs_default = /*#__PURE__*/ __webpack_require__.n(external_fs_namespaceObject);
|
|
49
|
-
const
|
|
49
|
+
const omit_js_namespaceObject = require("lodash/omit.js");
|
|
50
|
+
var omit_js_default = /*#__PURE__*/ __webpack_require__.n(omit_js_namespaceObject);
|
|
50
51
|
const external_path_namespaceObject = require("path");
|
|
51
52
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
52
53
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
@@ -65,7 +66,7 @@ function getInternalLoaderOptions(loaderContext) {
|
|
|
65
66
|
function getLoaderOptionsWithoutInternalKeys(loaderContext) {
|
|
66
67
|
const options = loaderContext.getOptions();
|
|
67
68
|
const circlePaths = [];
|
|
68
|
-
const loaderOptions = (
|
|
69
|
+
const loaderOptions = omit_js_default()(options, [
|
|
69
70
|
common_namespaceObject.Loader.LoaderInternalPropertyName
|
|
70
71
|
]);
|
|
71
72
|
(0, external_circleDetect_cjs_namespaceObject.checkCirclePath)(loaderOptions, [], circlePaths, 0);
|
|
@@ -3,7 +3,7 @@ import 'module';
|
|
|
3
3
|
import axios from "../../../compiled/axios/index.js";
|
|
4
4
|
import enhanced_resolve from "enhanced-resolve";
|
|
5
5
|
import fs from "fs";
|
|
6
|
-
import
|
|
6
|
+
import omit from "lodash/omit.js";
|
|
7
7
|
import path from "path";
|
|
8
8
|
import { logger } from "@rsdoctor/utils/logger";
|
|
9
9
|
import { Loader, Lodash, Time } from "@rsdoctor/utils/common";
|
|
@@ -40,13 +40,14 @@ const sdk_namespaceObject = require("@rsdoctor/sdk");
|
|
|
40
40
|
const plugins_namespaceObject = require("@rsdoctor/core/plugins");
|
|
41
41
|
const types_namespaceObject = require("@rsdoctor/types");
|
|
42
42
|
const logger_namespaceObject = require("@rsdoctor/utils/logger");
|
|
43
|
-
const
|
|
43
|
+
const cloneDeep_js_namespaceObject = require("lodash/cloneDeep.js");
|
|
44
|
+
var cloneDeep_js_default = /*#__PURE__*/ __webpack_require__.n(cloneDeep_js_namespaceObject);
|
|
44
45
|
const external_path_namespaceObject = require("path");
|
|
45
46
|
var external_path_default = /*#__PURE__*/ __webpack_require__.n(external_path_namespaceObject);
|
|
46
47
|
function processCompilerConfig(config) {
|
|
47
48
|
var _rest_module, _rest_module1;
|
|
48
49
|
const { plugins, infrastructureLogging, ...rest } = config;
|
|
49
|
-
const _rest = (
|
|
50
|
+
const _rest = cloneDeep_js_default()(rest);
|
|
50
51
|
if (null == (_rest_module = _rest.module) ? void 0 : _rest_module.defaultRules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.defaultRules);
|
|
51
52
|
if (null == (_rest_module1 = _rest.module) ? void 0 : _rest_module1.rules) (0, plugins_namespaceObject.makeRulesSerializable)(_rest.module.rules);
|
|
52
53
|
return {
|
|
@@ -4,7 +4,7 @@ import { openBrowser } from "@rsdoctor/sdk";
|
|
|
4
4
|
import { makeRulesSerializable } from "@rsdoctor/core/plugins";
|
|
5
5
|
import { SDK } from "@rsdoctor/types";
|
|
6
6
|
import { chalk } from "@rsdoctor/utils/logger";
|
|
7
|
-
import
|
|
7
|
+
import cloneDeep from "lodash/cloneDeep.js";
|
|
8
8
|
import path from "path";
|
|
9
9
|
function processCompilerConfig(config) {
|
|
10
10
|
var _rest_module, _rest_module1;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -29,7 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
38
|
const types_namespaceObject = require("@rsdoctor/types");
|
|
30
39
|
const external_rule_cjs_namespaceObject = require("../../rule.cjs");
|
|
31
40
|
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
32
|
-
const
|
|
41
|
+
const uniq_js_namespaceObject = require("lodash/uniq.js");
|
|
42
|
+
var uniq_js_default = /*#__PURE__*/ __webpack_require__.n(uniq_js_namespaceObject);
|
|
33
43
|
const title = 'cross-chunks-package';
|
|
34
44
|
const rule = (0, external_rule_cjs_namespaceObject.defineRule)(()=>({
|
|
35
45
|
meta: {
|
|
@@ -56,7 +66,7 @@ const rule = (0, external_rule_cjs_namespaceObject.defineRule)(()=>({
|
|
|
56
66
|
};
|
|
57
67
|
const chunks = [];
|
|
58
68
|
pkg.duplicates.forEach((dup)=>chunks.push(...dup.chunks.map((ck)=>ck.name)));
|
|
59
|
-
const message = (0, external_utils_cjs_namespaceObject.getErrorMsgForDupPckChunks)((
|
|
69
|
+
const message = (0, external_utils_cjs_namespaceObject.getErrorMsgForDupPckChunks)(uniq_js_default()(chunks), pkg.name);
|
|
60
70
|
report({
|
|
61
71
|
message,
|
|
62
72
|
detail
|
|
@@ -3,7 +3,7 @@ import 'module';
|
|
|
3
3
|
import { Linter } from "@rsdoctor/types";
|
|
4
4
|
import { defineRule } from "../../rule.js";
|
|
5
5
|
import { getErrorMsgForDupPckChunks } from "./utils.js";
|
|
6
|
-
import
|
|
6
|
+
import uniq from "lodash/uniq.js";
|
|
7
7
|
const title = 'cross-chunks-package';
|
|
8
8
|
const rule = defineRule(()=>({
|
|
9
9
|
meta: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
"enhanced-resolve": "5.12.0",
|
|
67
67
|
"filesize": "^10.1.6",
|
|
68
68
|
"fs-extra": "^11.1.1",
|
|
69
|
-
"lodash
|
|
69
|
+
"lodash": "^4.17.21",
|
|
70
70
|
"semver": "^7.7.3",
|
|
71
71
|
"source-map": "^0.7.6",
|
|
72
|
-
"@rsdoctor/
|
|
73
|
-
"@rsdoctor/
|
|
74
|
-
"@rsdoctor/utils": "1.3.
|
|
75
|
-
"@rsdoctor/
|
|
72
|
+
"@rsdoctor/graph": "1.3.3",
|
|
73
|
+
"@rsdoctor/sdk": "1.3.3",
|
|
74
|
+
"@rsdoctor/utils": "1.3.3",
|
|
75
|
+
"@rsdoctor/types": "1.3.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"axios": "^1.12.2",
|
|
79
79
|
"@rspack/core": "1.5.8",
|
|
80
80
|
"@types/fs-extra": "^11.0.4",
|
|
81
|
-
"@types/lodash
|
|
81
|
+
"@types/lodash": "^4.17.20",
|
|
82
82
|
"@types/node": "^22.8.1",
|
|
83
83
|
"@types/node-fetch": "^2.6.13",
|
|
84
84
|
"@types/semver": "^7.7.1",
|