@rsdoctor/webpack-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.map +1 -1
- package/dist/plugin.js +20 -4
- package/package.json +6 -6
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,sBAAsB,EACtB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,sBAAsB,EACtB,+BAA+B,EAC/B,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAe,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAa,MAAM,EAAO,MAAM,iBAAiB,CAAC;AAKzD,OAAO,KAAK,EAAE,QAAQ,EAA8B,MAAM,SAAS,CAAC;AAOpE,qBAAa,qBAAqB,CAAC,KAAK,SAAS,MAAM,CAAC,cAAc,EAAE,CACtE,YAAW,sBAAsB,CAAC,QAAQ,EAAE,KAAK,CAAC;IAElD,SAAgB,IAAI,2BAAiB;IAErC,SAAgB,OAAO,EAAE,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAEhE,SAAgB,GAAG,EAAE,kBAAkB,CAAC;IAExC,SAAgB,gBAAgB,EAAE,OAAO,CAAC;IAEnC,YAAY,EAAE,WAAW,CAAC;IAEjC,OAAO,CAAC,eAAe,CAAS;IAEzB,cAAc,EAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,SAAS,CAAC,eAAe,UAAS;IAE3B,UAAU,EAAE,UAAU,CAAC;gBAElB,OAAO,CAAC,EAAE,4BAA4B,CAAC,KAAK,CAAC;IAwBzD,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAuD1B,YAAY,aAAc,QAAQ,KAAG,IAAI,CAoC9C;IAEK,SAAS,aAAoB,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CAW1D;IAEF;;;;;OAKG;IACI,+BAA+B,CAAC,QAAQ,EAAE,QAAQ;IAIlD,IAAI,QAAa,OAAO,CAAC,IAAI,CAAC,CAwBnC;CACH"}
|
package/dist/plugin.js
CHANGED
|
@@ -67,7 +67,10 @@ class RsdoctorWebpackPlugin {
|
|
|
67
67
|
config: configuration
|
|
68
68
|
});
|
|
69
69
|
this.sdk.setOutputDir(
|
|
70
|
-
import_path.default.resolve(
|
|
70
|
+
import_path.default.resolve(
|
|
71
|
+
this.options.reportDir || compiler.outputPath,
|
|
72
|
+
`./${import_types.Constants.RsdoctorOutputFolder}`
|
|
73
|
+
)
|
|
71
74
|
);
|
|
72
75
|
if (configuration.name) {
|
|
73
76
|
this.sdk.setName(configuration.name);
|
|
@@ -78,8 +81,10 @@ class RsdoctorWebpackPlugin {
|
|
|
78
81
|
return;
|
|
79
82
|
await this._bootstrapTask.then(() => {
|
|
80
83
|
if (!this.options.disableClientServer && !this.browserIsOpened) {
|
|
81
|
-
this.
|
|
82
|
-
|
|
84
|
+
if (this.options.mode !== import_types.SDK.IMode[import_types.SDK.IMode.brief]) {
|
|
85
|
+
this.browserIsOpened = true;
|
|
86
|
+
this.sdk.server.openClientPage();
|
|
87
|
+
}
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
};
|
|
@@ -92,6 +97,15 @@ class RsdoctorWebpackPlugin {
|
|
|
92
97
|
if (this.options.disableClientServer) {
|
|
93
98
|
await this.sdk.dispose();
|
|
94
99
|
(0, import_logger.debug)(import_build.Process.getMemoryUsageMessage, "[After SDK Dispose]");
|
|
100
|
+
} else if (this.options.mode === import_types.SDK.IMode[import_types.SDK.IMode.brief] && !this.options.disableClientServer) {
|
|
101
|
+
const outputFilePath = import_path.default.resolve(
|
|
102
|
+
this.sdk.outputDir,
|
|
103
|
+
this.options.brief.reportHtmlName || "rsdoctor-report.html"
|
|
104
|
+
);
|
|
105
|
+
console.log(
|
|
106
|
+
`${import_logger.chalk.green("[RSDOCTOR] generated brief report")}: ${outputFilePath}`
|
|
107
|
+
);
|
|
108
|
+
(0, import_sdk.openBrowser)(`file:///${outputFilePath}`);
|
|
95
109
|
}
|
|
96
110
|
} catch (e) {
|
|
97
111
|
}
|
|
@@ -105,7 +119,9 @@ class RsdoctorWebpackPlugin {
|
|
|
105
119
|
config: {
|
|
106
120
|
disableTOSUpload: this.options.disableTOSUpload,
|
|
107
121
|
innerClientPath: this.options.innerClientPath,
|
|
108
|
-
printLog: this.options.printLog
|
|
122
|
+
printLog: this.options.printLog,
|
|
123
|
+
mode: this.options.mode ? this.options.mode : void 0,
|
|
124
|
+
brief: this.options.brief
|
|
109
125
|
}
|
|
110
126
|
});
|
|
111
127
|
this.outsideInstance = Boolean(this.options.sdkInstance);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/webpack-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
|
"fs-extra": "^11.1.1",
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@rsdoctor/core": "0.
|
|
19
|
-
"@rsdoctor/sdk": "0.
|
|
20
|
-
"@rsdoctor/graph": "0.
|
|
21
|
-
"@rsdoctor/
|
|
22
|
-
"@rsdoctor/
|
|
18
|
+
"@rsdoctor/core": "0.4.0",
|
|
19
|
+
"@rsdoctor/sdk": "0.4.0",
|
|
20
|
+
"@rsdoctor/graph": "0.4.0",
|
|
21
|
+
"@rsdoctor/utils": "0.4.0",
|
|
22
|
+
"@rsdoctor/types": "0.4.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"webpack": "^5.89.0",
|