@rsdoctor/rspack-plugin 1.0.0-beta.0 → 1.0.0-beta.2
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 +2 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +10 -1
- package/package.json +7 -7
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RsdoctorPrimarySDK, RsdoctorSDK } from '@rsdoctor/sdk';
|
|
2
|
-
import type { RsdoctorRspackPluginInstance,
|
|
2
|
+
import type { RsdoctorRspackPluginInstance, RsdoctorRspackPluginOptions, RsdoctorRspackPluginOptionsNormalized } from '@rsdoctor/core';
|
|
3
3
|
import { Linter, Plugin, SDK } from '@rsdoctor/types';
|
|
4
4
|
export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]> implements RsdoctorRspackPluginInstance<Rules> {
|
|
5
5
|
readonly name = "RsdoctorRspackPlugin";
|
|
@@ -8,7 +8,7 @@ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]>
|
|
|
8
8
|
_bootstrapTask: Promise<unknown>;
|
|
9
9
|
protected browserIsOpened: boolean;
|
|
10
10
|
modulesGraph: SDK.ModuleGraphInstance;
|
|
11
|
-
options:
|
|
11
|
+
options: RsdoctorRspackPluginOptionsNormalized<Rules>;
|
|
12
12
|
outsideInstance: boolean;
|
|
13
13
|
constructor(options?: RsdoctorRspackPluginOptions<Rules>);
|
|
14
14
|
apply(compiler: unknown): unknown;
|
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,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAc7E,OAAO,KAAK,EACV,4BAA4B,EAC5B
|
|
1
|
+
{"version":3,"file":"plugin.d.ts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await this.sdk.dispose();
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
this.options = (0, import_plugins.
|
|
89
|
+
this.options = (0, import_plugins.normalizeRspackUserOptions)(
|
|
90
90
|
Object.assign(options || {}, {
|
|
91
91
|
supports: {
|
|
92
92
|
...options?.supports,
|
|
@@ -168,6 +168,15 @@ class RsdoctorRspackPlugin {
|
|
|
168
168
|
}
|
|
169
169
|
new import_plugins.InternalRulesPlugin(this).apply(compiler);
|
|
170
170
|
new import_plugins.InternalErrorReporterPlugin(this).apply(compiler);
|
|
171
|
+
const RsdoctorRspackNativePlugin = compiler.webpack.experiments?.RsdoctorPlugin;
|
|
172
|
+
if (this.options.experiments?.enableNativePlugin && RsdoctorRspackNativePlugin) {
|
|
173
|
+
import_logger.logger.debug("[RspackNativePlugin] Enabled");
|
|
174
|
+
new RsdoctorRspackNativePlugin({
|
|
175
|
+
// TODO: more detailed data features based on the rsdoctor options
|
|
176
|
+
moduleGraphFeatures: true,
|
|
177
|
+
chunkGraphFeatures: true
|
|
178
|
+
}).apply(compiler);
|
|
179
|
+
}
|
|
171
180
|
}
|
|
172
181
|
/**
|
|
173
182
|
* @description Generate ModuleGraph and ChunkGraph from stats and webpack module apis;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/rspack-plugin",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"lodash": "^4.17.21",
|
|
17
|
-
"@rsdoctor/
|
|
18
|
-
"@rsdoctor/
|
|
19
|
-
"@rsdoctor/
|
|
20
|
-
"@rsdoctor/types": "1.0.0-beta.
|
|
21
|
-
"@rsdoctor/
|
|
17
|
+
"@rsdoctor/core": "1.0.0-beta.2",
|
|
18
|
+
"@rsdoctor/graph": "1.0.0-beta.2",
|
|
19
|
+
"@rsdoctor/utils": "1.0.0-beta.2",
|
|
20
|
+
"@rsdoctor/types": "1.0.0-beta.2",
|
|
21
|
+
"@rsdoctor/sdk": "1.0.0-beta.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@rspack/core": "^1.2.
|
|
24
|
+
"@rspack/core": "^1.2.5",
|
|
25
25
|
"@types/lodash": "^4.17.15",
|
|
26
26
|
"@types/node": "^16",
|
|
27
27
|
"@types/tapable": "2.2.7",
|