@rsbuild/plugin-react 2.0.0-rc.4 → 2.0.1
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 +31 -38
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -2,51 +2,44 @@ import type { RsbuildPlugin, Rspack } from '@rsbuild/core';
|
|
|
2
2
|
import type { PluginOptions as ReactRefreshOptions } from '@rspack/plugin-react-refresh';
|
|
3
3
|
export type SplitReactChunkOptions = {
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
react?: boolean;
|
|
5
|
+
* Whether to enable split chunking for React-related dependencies (e.g., react, react-dom, scheduler).
|
|
6
|
+
*
|
|
7
|
+
* @default true
|
|
8
|
+
*/ react?: boolean;
|
|
10
9
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
router?: boolean;
|
|
10
|
+
* Whether to enable split chunking for routing-related dependencies (e.g., react-router, react-router-dom, history).
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/ router?: boolean;
|
|
16
14
|
};
|
|
17
15
|
export type PluginReactOptions = {
|
|
18
16
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
swcReactOptions?: Rspack.SwcLoaderTransformConfig['react'];
|
|
17
|
+
* Configure the behavior of SWC to transform React code,
|
|
18
|
+
* the same as SWC's [jsc.transform.react](https://swc.rs/docs/configuration/compilation#jsctransformreact).
|
|
19
|
+
*/ swcReactOptions?: Rspack.SwcLoaderTransformConfig['react'];
|
|
23
20
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
splitChunks?: boolean | SplitReactChunkOptions;
|
|
21
|
+
* Configuration for chunk splitting of React-related dependencies when `chunkSplit.strategy`
|
|
22
|
+
* is set to `split-by-experience`.
|
|
23
|
+
* @default true
|
|
24
|
+
*/ splitChunks?: boolean | SplitReactChunkOptions;
|
|
29
25
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
enableProfiler?: boolean;
|
|
26
|
+
* When set to `true`, enables the React Profiler for performance analysis in production builds.
|
|
27
|
+
* @default false
|
|
28
|
+
*/ enableProfiler?: boolean;
|
|
34
29
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
reactRefreshOptions?: ReactRefreshOptions;
|
|
30
|
+
* Options passed to `@rspack/plugin-react-refresh`
|
|
31
|
+
* @default
|
|
32
|
+
* {
|
|
33
|
+
* include: [/\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/],
|
|
34
|
+
* exclude: [/[\\/]node_modules[\\/]/],
|
|
35
|
+
* resourceQuery: { not: /^\?raw$/ },
|
|
36
|
+
* }
|
|
37
|
+
* @see https://rspack.rs/guide/tech/react#rspackplugin-react-refresh
|
|
38
|
+
*/ reactRefreshOptions?: ReactRefreshOptions;
|
|
45
39
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fastRefresh?: boolean;
|
|
40
|
+
* Whether to enable React Fast Refresh in development mode.
|
|
41
|
+
* @default true
|
|
42
|
+
*/ fastRefresh?: boolean;
|
|
50
43
|
};
|
|
51
|
-
export declare const PLUGIN_REACT_NAME =
|
|
44
|
+
export declare const PLUGIN_REACT_NAME = 'rsbuild:react';
|
|
52
45
|
export declare const pluginReact: (options?: PluginReactOptions) => RsbuildPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "React plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@rsbuild/core-v1": "npm:@rsbuild/core@^1.7.5",
|
|
28
|
-
"@rslib/core": "0.
|
|
29
|
-
"@types/node": "^24.12.
|
|
30
|
-
"typescript": "^6.0.
|
|
31
|
-
"@rsbuild/core": "2.0.
|
|
28
|
+
"@rslib/core": "0.22.0",
|
|
29
|
+
"@types/node": "^24.12.4",
|
|
30
|
+
"typescript": "^6.0.3",
|
|
31
|
+
"@rsbuild/core": "2.0.9",
|
|
32
32
|
"@scripts/test-helper": "1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|