@rsbuild/plugin-react 0.3.1 → 0.3.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/index.d.ts CHANGED
@@ -28,6 +28,7 @@ type PluginReactOptions = {
28
28
  */
29
29
  splitChunks?: SplitReactChunkOptions;
30
30
  };
31
+ declare const PLUGIN_REACT_NAME = "rsbuild:react";
31
32
  declare const pluginReact: (options?: PluginReactOptions) => RsbuildPlugin;
32
33
 
33
- export { PluginReactOptions, SplitReactChunkOptions, isBeyondReact17, pluginReact };
34
+ export { PLUGIN_REACT_NAME, PluginReactOptions, SplitReactChunkOptions, isBeyondReact17, pluginReact };
package/dist/index.js CHANGED
@@ -30,10 +30,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ PLUGIN_REACT_NAME: () => PLUGIN_REACT_NAME,
33
34
  isBeyondReact17: () => isBeyondReact17,
34
35
  pluginReact: () => pluginReact
35
36
  });
36
37
  module.exports = __toCommonJS(src_exports);
38
+ var import_core = require("@rsbuild/core");
37
39
 
38
40
  // src/antd.ts
39
41
  var import_shared = require("@rsbuild/shared");
@@ -204,9 +206,10 @@ var isBeyondReact17 = async (cwd) => {
204
206
  };
205
207
 
206
208
  // src/index.ts
209
+ var PLUGIN_REACT_NAME = "rsbuild:react";
207
210
  var pluginReact = (options = {}) => ({
208
- name: "rsbuild:react",
209
- pre: ["rsbuild:swc"],
211
+ name: PLUGIN_REACT_NAME,
212
+ pre: [import_core.PLUGIN_SWC_NAME],
210
213
  setup(api) {
211
214
  if (api.context.bundlerType === "rspack") {
212
215
  applyBasicReactSupport(api, options);
@@ -218,6 +221,7 @@ var pluginReact = (options = {}) => ({
218
221
  });
219
222
  // Annotate the CommonJS export names for ESM import in node:
220
223
  0 && (module.exports = {
224
+ PLUGIN_REACT_NAME,
221
225
  isBeyondReact17,
222
226
  pluginReact
223
227
  });
package/dist/index.mjs CHANGED
@@ -14,6 +14,9 @@ import path from "path";
14
14
  import { createRequire } from "module";
15
15
  global.require = createRequire(import.meta.url);
16
16
 
17
+ // src/index.ts
18
+ import { PLUGIN_SWC_NAME } from "@rsbuild/core";
19
+
17
20
  // src/antd.ts
18
21
  import { isServerTarget } from "@rsbuild/shared";
19
22
  var getAntdMajorVersion = (appDirectory) => {
@@ -194,9 +197,10 @@ var isBeyondReact17 = async (cwd) => {
194
197
  };
195
198
 
196
199
  // src/index.ts
200
+ var PLUGIN_REACT_NAME = "rsbuild:react";
197
201
  var pluginReact = (options = {}) => ({
198
- name: "rsbuild:react",
199
- pre: ["rsbuild:swc"],
202
+ name: PLUGIN_REACT_NAME,
203
+ pre: [PLUGIN_SWC_NAME],
200
204
  setup(api) {
201
205
  if (api.context.bundlerType === "rspack") {
202
206
  applyBasicReactSupport(api, options);
@@ -207,6 +211,7 @@ var pluginReact = (options = {}) => ({
207
211
  }
208
212
  });
209
213
  export {
214
+ PLUGIN_REACT_NAME,
210
215
  isBeyondReact17,
211
216
  pluginReact
212
217
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-react",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "React plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,12 +24,12 @@
24
24
  "dependencies": {
25
25
  "@rspack/plugin-react-refresh": "0.5.0",
26
26
  "react-refresh": "^0.14.0",
27
- "@rsbuild/shared": "0.3.1"
27
+ "@rsbuild/shared": "0.3.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "16.x",
31
31
  "typescript": "^5.3.0",
32
- "@rsbuild/core": "0.3.1",
32
+ "@rsbuild/core": "0.3.2",
33
33
  "@scripts/test-helper": "1.0.0"
34
34
  },
35
35
  "publishConfig": {