@rsdoctor/rspack-plugin 0.3.4 → 0.3.5

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
@@ -1,9 +1,8 @@
1
- import type { Compiler } from '@rspack/core';
2
1
  import { ModuleGraph } from '@rsdoctor/graph';
3
2
  import { RsdoctorSlaveSDK, RsdoctorWebpackSDK } from '@rsdoctor/sdk';
4
- import type { RsdoctorPluginInstance, RsdoctorPluginOptionsNormalized, RsdoctorRspackPluginOptions } from '@rsdoctor/core';
5
- import { Linter } from '@rsdoctor/types';
6
- export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]> implements RsdoctorPluginInstance<Compiler, Rules> {
3
+ import type { RsdoctorRspackPluginInstance, RsdoctorPluginOptionsNormalized, RsdoctorRspackPluginOptions } from '@rsdoctor/core';
4
+ import { Linter, Plugin } from '@rsdoctor/types';
5
+ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]> implements RsdoctorRspackPluginInstance<Rules> {
7
6
  readonly name = "RsdoctorRspackPlugin";
8
7
  readonly sdk: RsdoctorWebpackSDK | RsdoctorSlaveSDK;
9
8
  _bootstrapTask: Promise<unknown>;
@@ -19,8 +18,8 @@ export declare class RsdoctorRspackPlugin<Rules extends Linter.ExtendRuleData[]>
19
18
  * @return {*}
20
19
  * @memberof RsdoctorWebpackPlugin
21
20
  */
22
- ensureModulesChunksGraphApplied(compiler: Compiler): void;
23
- done: (compiler: Compiler) => Promise<void>;
24
- getRspackConfig(compiler: Compiler): void;
21
+ ensureModulesChunksGraphApplied(compiler: Plugin.BaseCompilerType<'rspack'>): void;
22
+ done: (compiler: Plugin.BaseCompilerType<'rspack'>) => Promise<void>;
23
+ getRspackConfig(compiler: Plugin.BaseCompilerType<'rspack'>): void;
25
24
  }
26
25
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot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4B,EAC5B,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,MAAM,EAEN,MAAM,EACP,MAAM,iBAAiB,CAAC;AAOzB,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;IAEpD,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;IAiBxD,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAyDjC;;;;;OAKG;IACI,+BAA+B,CACpC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;IAKtC,IAAI,aACC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAC1C,QAAQ,IAAI,CAAC,CA6Bd;IAEK,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC;CA2BnE"}
package/dist/plugin.js CHANGED
@@ -96,17 +96,27 @@ class RsdoctorRspackPlugin {
96
96
  },
97
97
  this.done.bind(this, compiler)
98
98
  );
99
- new import_plugins.InternalSummaryPlugin(this).apply(compiler);
99
+ new import_plugins.InternalSummaryPlugin(this).apply(
100
+ compiler
101
+ );
100
102
  if (this.options.features.loader && !import_common.Loader.isVue(compiler)) {
101
103
  new import_probeLoaderPlugin.ProbeLoaderPlugin().apply(compiler);
102
- new import_plugins.InternalLoaderPlugin(this).apply(compiler);
104
+ new import_plugins.InternalLoaderPlugin(this).apply(
105
+ compiler
106
+ );
103
107
  }
104
108
  if (this.options.features.plugins) {
105
- new import_plugins.InternalPluginsPlugin(this).apply(compiler);
109
+ new import_plugins.InternalPluginsPlugin(this).apply(
110
+ compiler
111
+ );
106
112
  }
107
113
  if (this.options.features.bundle) {
108
- new import_plugins.InternalBundlePlugin(this).apply(compiler);
109
- new import_plugins.InternalBundleTagPlugin(this).apply(compiler);
114
+ new import_plugins.InternalBundlePlugin(this).apply(
115
+ compiler
116
+ );
117
+ new import_plugins.InternalBundleTagPlugin(
118
+ this
119
+ ).apply(compiler);
110
120
  }
111
121
  new import_plugins.InternalRulesPlugin(this).apply(compiler);
112
122
  new import_plugins.InternalErrorReporterPlugin(this).apply(compiler);
@@ -1,6 +1,6 @@
1
- import type { Compiler } from '@rspack/core';
1
+ import { Plugin } from '@rsdoctor/types';
2
2
  export declare class ProbeLoaderPlugin {
3
- apply(compiler: Compiler): void;
3
+ apply(compiler: Plugin.BaseCompiler): void;
4
4
  private addProbeLoader;
5
5
  }
6
6
  //# sourceMappingURL=probeLoaderPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"probeLoaderPlugin.d.ts","sourceRoot":"","sources":["../src/probeLoaderPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAS7C,qBAAa,iBAAiB;IAC5B,KAAK,CAAC,QAAQ,EAAE,QAAQ;IAoBxB,OAAO,CAAC,cAAc;CA0CvB"}
1
+ {"version":3,"file":"probeLoaderPlugin.d.ts","sourceRoot":"","sources":["../src/probeLoaderPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,qBAAa,iBAAiB;IAC5B,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,YAAY;IAoBnC,OAAO,CAAC,cAAc;CA+CvB"}
@@ -33,6 +33,7 @@ __export(probeLoaderPlugin_exports, {
33
33
  module.exports = __toCommonJS(probeLoaderPlugin_exports);
34
34
  var import_build_utils = require("@rsdoctor/core/build-utils");
35
35
  var import_path = __toESM(require("path"));
36
+ var import_core = require("@rsdoctor/core");
36
37
  const BuiltinLoaderName = "builtin:swc-loader";
37
38
  const ESMLoaderFile = ".mjs";
38
39
  class ProbeLoaderPlugin {
@@ -81,14 +82,15 @@ class ProbeLoaderPlugin {
81
82
  };
82
83
  compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
83
84
  rules,
84
- BuiltinLoaderName,
85
- appendRule
85
+ appendRule,
86
+ (r) => import_core.Build.Utils.getLoaderNameMatch(r, BuiltinLoaderName, true)
86
87
  );
87
88
  compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
88
89
  rules,
89
- ESMLoaderFile,
90
90
  appendRule,
91
- false
91
+ (r) => {
92
+ return import_core.Build.Utils.getLoaderNameMatch(r, ESMLoaderFile, false) || import_core.Build.Utils.isESMLoader(r);
93
+ }
92
94
  );
93
95
  }
94
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/rspack-plugin",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -15,14 +15,14 @@
15
15
  "dependencies": {
16
16
  "loader-utils": "^2.0.4",
17
17
  "lodash": "^4.17.21",
18
- "@rsdoctor/core": "0.3.4",
19
- "@rsdoctor/graph": "0.3.4",
20
- "@rsdoctor/sdk": "0.3.4",
21
- "@rsdoctor/utils": "0.3.4",
22
- "@rsdoctor/types": "0.3.4"
18
+ "@rsdoctor/core": "0.3.5",
19
+ "@rsdoctor/graph": "0.3.5",
20
+ "@rsdoctor/sdk": "0.3.5",
21
+ "@rsdoctor/utils": "0.3.5",
22
+ "@rsdoctor/types": "0.3.5"
23
23
  },
24
24
  "devDependencies": {
25
- "@rspack/core": "0.6.5",
25
+ "@rspack/core": "0.7.5",
26
26
  "@types/loader-utils": "^2.0.5",
27
27
  "@types/lodash": "^4.17.0",
28
28
  "@types/node": "^16",