@rsdoctor/rspack-plugin 0.2.3-beta.0 → 0.2.3

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.js CHANGED
@@ -38,7 +38,7 @@ var import_types = require("@rsdoctor/types");
38
38
  var import_path = __toESM(require("path"));
39
39
  var import_constants = require("./constants");
40
40
  var import_lodash = require("lodash");
41
- var import_builtinLoaderPlugin = require("./builtinLoaderPlugin");
41
+ var import_probeLoaderPlugin = require("./probeLoaderPlugin");
42
42
  var import_common = require("@rsdoctor/utils/common");
43
43
  class RsdoctorRspackPlugin {
44
44
  constructor(options) {
@@ -107,6 +107,7 @@ class RsdoctorRspackPlugin {
107
107
  );
108
108
  new import_plugins.InternalSummaryPlugin(this).apply(compiler);
109
109
  if (this.options.features.loader && !import_common.Loader.isVue(compiler)) {
110
+ new import_probeLoaderPlugin.ProbeLoaderPlugin().apply(compiler);
110
111
  new import_plugins.InternalLoaderPlugin(this).apply(compiler);
111
112
  }
112
113
  if (this.options.features.plugins) {
@@ -116,9 +117,7 @@ class RsdoctorRspackPlugin {
116
117
  new import_plugins.InternalBundlePlugin(this).apply(compiler);
117
118
  }
118
119
  new import_plugins.InternalRulesPlugin(this).apply(compiler);
119
- if (!import_common.Loader.isVue(compiler)) {
120
- new import_builtinLoaderPlugin.BuiltinLoaderPlugin().apply(compiler);
121
- }
120
+ new import_plugins.InternalErrorReporterPlugin(this).apply(compiler);
122
121
  }
123
122
  /**
124
123
  * @description Generate ModuleGraph and ChunkGraph from stats and webpack module apis;
@@ -1,5 +1,5 @@
1
1
  import type { Compiler } from '@rspack/core';
2
- export declare class BuiltinLoaderPlugin {
2
+ export declare class ProbeLoaderPlugin {
3
3
  apply(compiler: Compiler): void;
4
4
  private addProbeLoader;
5
5
  }
@@ -26,19 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var builtinLoaderPlugin_exports = {};
30
- __export(builtinLoaderPlugin_exports, {
31
- BuiltinLoaderPlugin: () => BuiltinLoaderPlugin
29
+ var probeLoaderPlugin_exports = {};
30
+ __export(probeLoaderPlugin_exports, {
31
+ ProbeLoaderPlugin: () => ProbeLoaderPlugin
32
32
  });
33
- module.exports = __toCommonJS(builtinLoaderPlugin_exports);
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
36
  const BuiltinLoaderName = "builtin:swc-loader";
37
- class BuiltinLoaderPlugin {
37
+ const ESMLoaderFile = ".mjs";
38
+ class ProbeLoaderPlugin {
38
39
  apply(compiler) {
39
40
  compiler.hooks.beforeRun.tap(
40
41
  {
41
- name: "BuiltinLoaderPlugin"
42
+ name: "ProbeLoaderPlugin"
42
43
  },
43
44
  () => {
44
45
  this.addProbeLoader(compiler);
@@ -46,7 +47,7 @@ class BuiltinLoaderPlugin {
46
47
  );
47
48
  compiler.hooks.watchRun.tap(
48
49
  {
49
- name: "BuiltinLoaderPlugin"
50
+ name: "ProbeLoaderPlugin"
50
51
  },
51
52
  () => {
52
53
  this.addProbeLoader(compiler);
@@ -78,14 +79,20 @@ class BuiltinLoaderPlugin {
78
79
  }
79
80
  return rule;
80
81
  };
81
- compiler.options.module.rules = import_build_utils.Utils.changeBuiltinLoader(
82
+ compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
82
83
  rules,
83
84
  BuiltinLoaderName,
84
85
  appendRule
85
86
  );
87
+ compiler.options.module.rules = import_build_utils.Utils.addProbeLoader2Rules(
88
+ rules,
89
+ ESMLoaderFile,
90
+ appendRule,
91
+ false
92
+ );
86
93
  }
87
94
  }
88
95
  // Annotate the CommonJS export names for ESM import in node:
89
96
  0 && (module.exports = {
90
- BuiltinLoaderPlugin
97
+ ProbeLoaderPlugin
91
98
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/rspack-plugin",
3
- "version": "0.2.3-beta.0",
3
+ "version": "0.2.3",
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.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"
18
+ "@rsdoctor/core": "0.2.3",
19
+ "@rsdoctor/graph": "0.2.3",
20
+ "@rsdoctor/utils": "0.2.3",
21
+ "@rsdoctor/sdk": "0.2.3"
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.3-beta.0"
31
+ "@rsdoctor/types": "0.2.3"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@rspack/core": "^0.5.1"