@rsdoctor/rspack-plugin 0.2.2 → 0.2.3-beta.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 CHANGED
@@ -10,6 +10,7 @@ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]>
10
10
  protected browserIsOpened: boolean;
11
11
  modulesGraph: ModuleGraph;
12
12
  options: RsdoctorPluginOptionsNormalized<Rules>;
13
+ outsideInstance: boolean;
13
14
  constructor(options?: RsdoctorRspackPluginOptions<Rules>);
14
15
  apply(compiler: unknown): unknown;
15
16
  /**
package/dist/plugin.js CHANGED
@@ -60,8 +60,15 @@ class RsdoctorRspackPlugin {
60
60
  this.sdk.addClientRoutes([
61
61
  import_types.Manifest.RsdoctorManifestClientRoutes.Overall
62
62
  ]);
63
- const _sdk = (0, import_plugins.getSDK)(compiler.options.name);
64
- _sdk.setOutputDir(
63
+ if (this.outsideInstance && "parent" in this.sdk) {
64
+ this.sdk.parent.master.setOutputDir(
65
+ import_path.default.resolve(
66
+ compiler.outputPath,
67
+ `./${import_types.Constants.RsdoctorOutputFolder}`
68
+ )
69
+ );
70
+ }
71
+ this.sdk.setOutputDir(
65
72
  import_path.default.resolve(compiler.outputPath, `./${import_types.Constants.RsdoctorOutputFolder}`)
66
73
  );
67
74
  await this.sdk.writeStore();
@@ -80,6 +87,7 @@ class RsdoctorRspackPlugin {
80
87
  config: { disableTOSUpload: this.options.disableTOSUpload },
81
88
  innerClientPath: this.options.innerClientPath
82
89
  });
90
+ this.outsideInstance = Boolean(this.options.sdkInstance);
83
91
  this.modulesGraph = new import_graph.ModuleGraph();
84
92
  }
85
93
  apply(compiler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/rspack-plugin",
3
- "version": "0.2.2",
3
+ "version": "0.2.3-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -15,10 +15,10 @@
15
15
  "dependencies": {
16
16
  "loader-utils": "^2.0.4",
17
17
  "lodash": "^4.17.21",
18
- "@rsdoctor/core": "0.2.2",
19
- "@rsdoctor/graph": "0.2.2",
20
- "@rsdoctor/utils": "0.2.2",
21
- "@rsdoctor/sdk": "0.2.2"
18
+ "@rsdoctor/core": "0.2.3-beta.0",
19
+ "@rsdoctor/graph": "0.2.3-beta.0",
20
+ "@rsdoctor/utils": "0.2.3-beta.0",
21
+ "@rsdoctor/sdk": "0.2.3-beta.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@rspack/core": "0.5.1",
@@ -28,7 +28,7 @@
28
28
  "@types/tapable": "2.2.2",
29
29
  "tslib": "2.4.1",
30
30
  "typescript": "^5.2.2",
31
- "@rsdoctor/types": "0.2.2"
31
+ "@rsdoctor/types": "0.2.3-beta.0"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@rspack/core": "^0.5.1"