@rsbuild/plugin-react 1.0.2 → 1.0.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/index.cjs CHANGED
@@ -78,9 +78,11 @@ var applyBasicReactSupport = (api, options) => {
78
78
  );
79
79
  const { default: ReactRefreshRspackPlugin } = await import("@rspack/plugin-react-refresh");
80
80
  const SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/;
81
+ const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
81
82
  chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactRefreshRspackPlugin, [
82
83
  {
83
84
  include: [SCRIPT_REGEX],
85
+ exclude: [NODE_MODULES_REGEX],
84
86
  ...options.reactRefreshOptions
85
87
  }
86
88
  ]);
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  throw Error('Dynamic require of "' + x + '" is not supported');
10
10
  });
11
11
 
12
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.59.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
12
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.60.1_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
13
13
  import path from "path";
14
14
  import { fileURLToPath } from "url";
15
15
 
@@ -56,9 +56,11 @@ var applyBasicReactSupport = (api, options) => {
56
56
  );
57
57
  const { default: ReactRefreshRspackPlugin } = await import("@rspack/plugin-react-refresh");
58
58
  const SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/;
59
+ const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
59
60
  chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactRefreshRspackPlugin, [
60
61
  {
61
62
  include: [SCRIPT_REGEX],
63
+ exclude: [NODE_MODULES_REGEX],
62
64
  ...options.reactRefreshOptions
63
65
  }
64
66
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-react",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "React plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@types/node": "18.x",
31
31
  "typescript": "^5.5.2",
32
- "@rsbuild/core": "1.0.3",
32
+ "@rsbuild/core": "1.0.8",
33
33
  "@scripts/test-helper": "1.0.1"
34
34
  },
35
35
  "peerDependencies": {