@rsdoctor/rspack-plugin 0.3.11 → 0.4.0
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/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +25 -5
- package/package.json +6 -6
package/dist/plugin.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]>
|
|
|
20
20
|
* @memberof RsdoctorWebpackPlugin
|
|
21
21
|
*/
|
|
22
22
|
ensureModulesChunksGraphApplied(compiler: Plugin.BaseCompilerType<'rspack'>): void;
|
|
23
|
-
done: (compiler: Plugin.BaseCompilerType<
|
|
23
|
+
done: (compiler: Plugin.BaseCompilerType<"rspack">) => Promise<void>;
|
|
24
24
|
getRspackConfig(compiler: Plugin.BaseCompilerType<'rspack'>): void;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAcvB,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,MAAM,EAEN,MAAM,EAEP,MAAM,iBAAiB,CAAC;AAQzB,qBAAa,oBAAoB,CAAC,KAAK,SAAS,MAAM,CAAC,cAAc,EAAE,CACrE,YAAW,4BAA4B,CAAC,KAAK,CAAC;IAE9C,SAAgB,IAAI,0BAAiB;IAErC,SAAgB,GAAG,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;IAE3D,SAAgB,gBAAgB,EAAE,OAAO,CAAC;IAEnC,cAAc,EAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,SAAS,CAAC,eAAe,UAAS;IAE3B,YAAY,EAAE,WAAW,CAAC;IAE1B,OAAO,EAAE,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAEhD,eAAe,EAAE,OAAO,CAAC;gBAEpB,OAAO,CAAC,EAAE,2BAA2B,CAAC,KAAK,CAAC;IAiCxD,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAyDjC;;;;;OAKG;IACI,+BAA+B,CACpC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IAKtC,IAAI,aACC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAC1C,OAAO,CAAC,IAAI,CAAC,CA6Cd;IAEK,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;CA8BnE"}
|
package/dist/plugin.js
CHANGED
|
@@ -40,6 +40,7 @@ var import_constants = require("./constants");
|
|
|
40
40
|
var import_lodash = require("lodash");
|
|
41
41
|
var import_probeLoaderPlugin = require("./probeLoaderPlugin");
|
|
42
42
|
var import_common = require("@rsdoctor/utils/common");
|
|
43
|
+
var import_logger = require("@rsdoctor/utils/logger");
|
|
43
44
|
class RsdoctorRspackPlugin {
|
|
44
45
|
constructor(options) {
|
|
45
46
|
this.name = import_constants.pluginTapName;
|
|
@@ -53,17 +54,31 @@ class RsdoctorRspackPlugin {
|
|
|
53
54
|
if (this.outsideInstance && "parent" in this.sdk) {
|
|
54
55
|
this.sdk.parent.master.setOutputDir(
|
|
55
56
|
import_path.default.resolve(
|
|
56
|
-
compiler.outputPath,
|
|
57
|
+
this.options.reportDir || compiler.outputPath,
|
|
57
58
|
`./${import_types.Constants.RsdoctorOutputFolder}`
|
|
58
59
|
)
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
62
|
this.sdk.setOutputDir(
|
|
62
|
-
import_path.default.resolve(
|
|
63
|
+
import_path.default.resolve(
|
|
64
|
+
this.options.reportDir || compiler.outputPath,
|
|
65
|
+
`./${import_types.Constants.RsdoctorOutputFolder}`
|
|
66
|
+
)
|
|
63
67
|
);
|
|
64
68
|
await this.sdk.writeStore();
|
|
65
69
|
if (!this.options.disableClientServer) {
|
|
66
|
-
|
|
70
|
+
if (this.options.mode === import_types.SDK.IMode[import_types.SDK.IMode.brief]) {
|
|
71
|
+
const outputFilePath = import_path.default.resolve(
|
|
72
|
+
this.sdk.outputDir,
|
|
73
|
+
this.options.brief.reportHtmlName || "rsdoctor-report.html"
|
|
74
|
+
);
|
|
75
|
+
console.log(
|
|
76
|
+
`${import_logger.chalk.green("[RSDOCTOR] generated brief report")}: ${outputFilePath}`
|
|
77
|
+
);
|
|
78
|
+
(0, import_sdk.openBrowser)(`file:///${outputFilePath}`);
|
|
79
|
+
} else {
|
|
80
|
+
await this.sdk.server.openClientPage("homepage");
|
|
81
|
+
}
|
|
67
82
|
}
|
|
68
83
|
if (this.options.disableClientServer) {
|
|
69
84
|
await this.sdk.dispose();
|
|
@@ -86,7 +101,9 @@ class RsdoctorRspackPlugin {
|
|
|
86
101
|
config: {
|
|
87
102
|
disableTOSUpload: this.options.disableTOSUpload,
|
|
88
103
|
innerClientPath: this.options.innerClientPath,
|
|
89
|
-
printLog: this.options.printLog
|
|
104
|
+
printLog: this.options.printLog,
|
|
105
|
+
mode: this.options.mode ? this.options.mode : void 0,
|
|
106
|
+
brief: this.options.brief
|
|
90
107
|
}
|
|
91
108
|
});
|
|
92
109
|
this.outsideInstance = Boolean(this.options.sdkInstance);
|
|
@@ -161,7 +178,10 @@ class RsdoctorRspackPlugin {
|
|
|
161
178
|
config: configuration
|
|
162
179
|
});
|
|
163
180
|
this.sdk.setOutputDir(
|
|
164
|
-
import_path.default.resolve(
|
|
181
|
+
import_path.default.resolve(
|
|
182
|
+
this.options.reportDir || compiler.outputPath,
|
|
183
|
+
`./${import_types.Constants.RsdoctorOutputFolder}`
|
|
184
|
+
)
|
|
165
185
|
);
|
|
166
186
|
}
|
|
167
187
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/rspack-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"loader-utils": "^2.0.4",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@rsdoctor/core": "0.
|
|
19
|
-
"@rsdoctor/graph": "0.
|
|
20
|
-
"@rsdoctor/sdk": "0.
|
|
21
|
-
"@rsdoctor/utils": "0.
|
|
22
|
-
"@rsdoctor/types": "0.
|
|
18
|
+
"@rsdoctor/core": "0.4.0",
|
|
19
|
+
"@rsdoctor/graph": "0.4.0",
|
|
20
|
+
"@rsdoctor/sdk": "0.4.0",
|
|
21
|
+
"@rsdoctor/utils": "0.4.0",
|
|
22
|
+
"@rsdoctor/types": "0.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@rspack/core": "0.7.5",
|