@rsdoctor/core 0.1.9-beta.1 → 0.1.10
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.
|
@@ -121,10 +121,17 @@ function getModuleGraphByStats({ modules, chunks }, root, chunkGraph) {
|
|
|
121
121
|
normal.depth === 0,
|
|
122
122
|
import_types.SDK.ModuleKind.Normal
|
|
123
123
|
);
|
|
124
|
-
normal.chunks?.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
if (normal.chunks?.length) {
|
|
125
|
+
normal.chunks?.forEach((_chunkId) => {
|
|
126
|
+
const chunk = chunkGraph.getChunkById(String(_chunkId));
|
|
127
|
+
chunk && normalModule.addChunk(chunk);
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
data.chunks?.forEach((_chunkId) => {
|
|
131
|
+
const chunk = chunkGraph.getChunkById(String(_chunkId));
|
|
132
|
+
chunk && normalModule.addChunk(chunk);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
128
135
|
if (normal.source) {
|
|
129
136
|
normalModule.setSource({
|
|
130
137
|
transformed: Buffer.isBuffer(normal.source) ? normal.source.toString() : normal.source
|
|
@@ -171,7 +171,7 @@ async function reportLoader(ctx, start, startHRTime, isPitch, sync, code, err, r
|
|
|
171
171
|
file: loaderData[0].resource.path
|
|
172
172
|
};
|
|
173
173
|
const sdk = (0, import_sdk.getSDK)();
|
|
174
|
-
if (sdk?.reportLoader) {
|
|
174
|
+
if (sdk?.reportLoader && !("parent" in sdk && sdk.parent)) {
|
|
175
175
|
sdk.reportLoader(loaderData);
|
|
176
176
|
sdk.reportSourceMap(sourceMapData);
|
|
177
177
|
return loaderData;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RsdoctorWebpackSDK } from '@rsdoctor/sdk';
|
|
2
2
|
export declare function setSDK(t: RsdoctorWebpackSDK): void;
|
|
3
|
-
export declare function getSDK(): RsdoctorWebpackSDK
|
|
3
|
+
export declare function getSDK(builderName?: string): RsdoctorWebpackSDK<import("@rsdoctor/sdk/dist/type/sdk/sdk/types").RsdoctorWebpackSDKOptions>;
|
|
@@ -26,7 +26,14 @@ let sdk;
|
|
|
26
26
|
function setSDK(t) {
|
|
27
27
|
sdk = t;
|
|
28
28
|
}
|
|
29
|
-
function getSDK() {
|
|
29
|
+
function getSDK(builderName) {
|
|
30
|
+
if (sdk && builderName && "parent" in sdk) {
|
|
31
|
+
const _sdk = sdk;
|
|
32
|
+
const slaveSDK = _sdk.parent.slaves.find(
|
|
33
|
+
(_sdk2) => _sdk2.name === builderName
|
|
34
|
+
);
|
|
35
|
+
return slaveSDK || sdk;
|
|
36
|
+
}
|
|
30
37
|
return sdk;
|
|
31
38
|
}
|
|
32
39
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface RsdoctorWebpackPluginOptions<Rules extends LinterType.ExtendRul
|
|
|
48
48
|
*/
|
|
49
49
|
innerClientPath?: string;
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
51
|
+
export interface RsdoctorMultiplePluginOptions<Rules extends LinterType.ExtendRuleData[] = LinterType.ExtendRuleData[]> extends Omit<RsdoctorWebpackPluginOptions<Rules>, 'sdkInstance'>, Pick<ConstructorParameters<typeof RsdoctorSlaveSDK>[0], 'stage'> {
|
|
52
52
|
/**
|
|
53
53
|
* name of builder
|
|
54
54
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"semver": "^7.5.4",
|
|
51
51
|
"source-map": "^0.7.4",
|
|
52
52
|
"webpack-bundle-analyzer": "^4.9.1",
|
|
53
|
-
"@rsdoctor/graph": "0.1.
|
|
54
|
-
"@rsdoctor/sdk": "0.1.
|
|
55
|
-
"@rsdoctor/utils": "0.1.
|
|
53
|
+
"@rsdoctor/graph": "0.1.10",
|
|
54
|
+
"@rsdoctor/sdk": "0.1.10",
|
|
55
|
+
"@rsdoctor/utils": "0.1.10"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@rspack/core": "0.5.1",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"tslib": "2.4.1",
|
|
73
73
|
"typescript": "^5.2.2",
|
|
74
74
|
"webpack": "^5.89.0",
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
75
|
+
"@rsdoctor/types": "0.1.10",
|
|
76
|
+
"@scripts/test-helper": "0.1.1"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public",
|